Flutter's Path Towards Seamless Interop
Article Summary
Mariam Hasnany from Google's Flutter team just announced a game-changer for plugin developers: direct native interop that could eliminate the tedious boilerplate that's been slowing everyone down.
Flutter is launching an early access program for FFIgen and JNIgen, code generation tools that bridge Dart with native iOS and Android APIs directly. This replaces the current method channels approach that requires extensive hand-written code and manual maintenance for every API update.
Key Takeaways
- FFIgen and JNIgen auto-generate bindings for Objective-C, Swift, Java, and Kotlin APIs
- Enables synchronous API calls and tree-shaking, unlike async-only method channels
- Eliminates manual encoding/decoding that causes runtime errors when APIs change
- Early access program opens June 20th for experienced plugin developers
- Pigeon reduced some pain, but large APIs still require tedious manual coding
Flutter's new direct interop approach aims to drastically cut the time developers spend bridging Dart with native platform code while reducing maintenance burden and runtime errors.
About This Article
Flutter developers spend a lot of time implementing and maintaining method channels. Every time native APIs change versions, they have to write and update extensive amounts of code by hand.
FFIgen and JNIgen are code generation tools that automatically create bindings for Objective-C, Swift, Java, and Kotlin APIs. This removes the need to write manual bridging code between Dart and native platforms.
Experienced plugin developers in the early access program will spend far less time writing boilerplate code and maintaining it. Selected candidates will be notified after June 20th, 2025 to start rebuilding production plugins using direct interop.