Flutter Plugins - From Method Channels to Native Interop
summary
Explains concrete migration paths from method channels to native interop with examples: a PDF viewer plugin and a Google Play binding generated with jnigen that runs in production for tens of thousands of users. Shows benchmarks: calling native via FFI 100,000 times takes about 4 ms vs much higher overhead for method channels. Covers tooling and caveats: use ffigen+generated bindings, SwiftGen is usable but experimental, watch main-thread blocking after the UI/platform thread merge, and how obfuscated native libs were integrated and debugged.
AI-written summary · about
chapters (9)
- 0:00Flutter native interop intro
- 4:32Platform channels basics
- 12:21Method/event channels deep dive
- 16:13Threading and UI thread issues
- 18:18Native interop evolution
- 22:31Calling Swift from Dart
- 25:23JNI for Kotlin/Java
- 31:12SwiftGen for Swift bindings
- 34:23Future of native interop
related talks
30mBinding Native Plugins with Flutter and Dart
38mThe past, present, and future of native interop
50mPast, Present and Future of Native Interop
43mSummit Session 2 - Past, Present and Future of Native Interop
31mSeamless Interoperability: Harnessing JNIGen and FFIGen
41mPlugins: Your Bridge to Native Code
39mAdopting native assets for cross-platform FFI plugins
26mPower of federated plugins in Flutter's ecosystem
