Repository navigation
Migrate platform channels to Pigeon 29 - #352
Merged
Merged
Conversation
Regenerate all Pigeon outputs with 29.0.10 (from 26.3.4). Pigeon >= 28 defaults async methods to native async/suspend; annotate the async HostApi methods and every FlutterApi method with @asynccallback to keep the existing callback-based native implementations (Swift completions, Kotlin callbacks) unchanged and avoid adding a coroutines dependency. The Dart FlutterApi abstract methods become Future, so the two Dart callback implementers are updated to async bodies (still effectively synchronous). Regenerated: lib/src/universal_ble.g.dart, UniversalBle.g.kt, UniversalBle.g.swift, windows/src/generated/universal_ble.g.{h,cpp}.
rohitsangwan01
approved these changes
Oct 16, 2026
rohitsangwan01
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #347: the same Pigeon 29 regeneration, but preserving the existing callback-style native code via
@asyncCallbackinstead of migrating the plugins to nativeasync/suspend.Approach
Pigeon ≥ 28 changes the generated channel shape by default:
@HostApimethods annotated@async→suspend(Kotlin) /async throws(Swift)@FlutterApimethods → async by defaultAnnotating the async HostApi methods and all FlutterApi methods with
@asyncCallbackkeeps the generated native signatures callback-based, so the hand-written plugins need no changes and no coroutines dependency is required. C++ was already callback-based and is unaffected either way.Changes
pigeon/universal_ble.dart:@async→@asyncCallback(19 HostApi methods) and@asyncCallbackadded to all 15 FlutterApi methods.lib/src/universal_ble.g.dart,UniversalBle.g.kt,UniversalBle.g.swift,windows/.../universal_ble.g.{h,cpp}); Dart file formatted.lib/src/universal_ble_pigeon/*.dart: the FlutterApi methods now returnFutureon the Dart side, so the two callback implementers were madeasync(bodies stay synchronous).CHANGELOG.md: 3.1.1 note.No public Dart API change (the callback classes are not re-exported); still 3.1.1.
Differences from #347
suspendCancellableCoroutine, nokotlinx-coroutines), Swift stays completion-based (nowithCheckedThrowingContinuation, noTask { @MainActor }).suspend funand 0async throws.operator<<,PigeonInternalToString).Verification
flutter analyze— cleanflutter test— 285 passedflutter build macos --debug— builtflutter build ios --debug --no-codesign— builtexample/android:./gradlew :universal_ble:testDebugUnitTest(JDK 21) — BUILD SUCCESSFULNotes
flutter build windows+ ctest.