r/FlutterDev • • 14d ago

Plugin Anyone migrating plugins to Pigeon's native interop (FFI/JNI) yet?

Flutter's stable-native-interop post landed last week, and I'm curious how plugin maintainers are approaching it in real codebases.

What's actually stable now

  • FFIgen for C and Objective-C
  • JNIgen for Java/Kotlin (Android system APIs + your AARs/JARs)

What's preview

  • Pigeon with native interop (swiftOptions: SwiftOptions(useFfi: true), kotlinOptions: KotlinOptions(useJni: true))
  • Skips the platform-channel serialization path; synchronous calls + background isolates become realistic

Docs point to shared_preferences as a reference migration — migration guide + an AI-oriented "native interop migration skill" for agents.

Questions for the room

  1. Are you starting new plugins on Pigeon+interop, or only migrating hot paths?
  2. Windows/Linux still channel-based — does that split your public API design?
  3. What broke for you? (build hooks, app directory for JNIgen, object lifetimes?)

I'm especially interested in plugins that were already Pigeon-clean — was the move "flip flags + rebuild" or a week of yak shaving?

Links:

15 Upvotes

5 comments sorted by

1

u/TesteurManiak 6d ago

I've used it for a package I've made that wraps Nearby Connections' API: https://github.com/TesteurManiak/native_nearby_connections
The Flutter team has published some documentation on how to migrate your pigeon's configuration: https://github.com/flutter/packages/blob/main/packages/pigeon/native_interop_guide.md

1

u/ObjectiveAddress3051 6d ago

Ok thanks man. I would like the flutter team to provide most of the native functionality to work out of box for the io platforms rather then depending upon the plugin using dart ffi or platform.

1

u/TesteurManiak 6d ago

While it doesn't work out of the box, writing a wrapper for native APIs has never been easier, if you check the Android part of my package, you'll see that it's really just basic wrapping to make Android call Dart's bindings and vice-versa and it just works. Now the heavy work is just to define proper interfaces for pigeon.

1

u/ObjectiveAddress3051 6d ago

You seem like an experienced one. But I have major exp in android and flutter. I don't understand ios, web, mac, Linux and windows. If I want one native universal functionality like get battery level then it's headache for me to implement all of them. I understand using ai we can generate but we will not be able to verify since most of persons are not all rounder across all the platform technologies.

0

u/_ri4na 13d ago

Looks like no one bothers with this