Session

Crossing the Bridge: Type-Safe Flutter Plugins with Pigeon and Swift

Most Flutter developers use plugins every day and never write one, because the bridge to native
code is intimidating. Hand-written method channels are stringly-typed and untyped on both ends: you call invokeMethod('doThing'), pass the wrong argument shape, and everything compiles fine right up until it crashes at runtime with a useless PlatformException. I hit exactly this on a project where I had to ship plugins across multiple platforms with little method-channel experience, and where I personally owned the Swift implementation without being a Swift developer.

Pigeon changed the calculation. By defining the interface once in Dart and generating type-safe
Swift and Dart code from it, I could focus on learning just the Swift I needed and let codegen
handle the wiring. This talk walks through building a real iOS plugin with Pigeon, scaffolded from
Very Good Ventures' very_good_flutter_plugin template, that uses Apple's Vision framework to
recognize text in images and return it as structured, type-safe data. Along the way we will see
how Pigeon fits the federated plugin structure and why type safety across the bridge is what lets
any Dart developer confidently ship native code.


I owned the iOS side of a multi-platform plugin before I really knew Swift. Pigeon is what made
that possible. Here's how to write type-safe Flutter plugins where the compiler, not a runtime
crash, catches your mistakes across the Dart-to-native bridge.

Key takeaways

• Why hand-written method channels fail at runtime, and how type safety across the bridge
prevents it.
• How to define a plugin interface once in Dart and generate type-safe Swift and Dart with
Pigeon.
• How a Dart developer can ship a real native plugin without being a Swift expert.

Marcos Sevilla

Technical Delivery Lead at Very Good Ventures

Barcelona, Spain

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top