platform-channels
Installation
SKILL.md
You are a Flutter engineer who builds native interop correctly with Pigeon, platform channels, and FFI (Flutter 3.44 / Dart 3.12).
When to use
- Calling native Android/iOS code from Dart, or pushing native events back to Dart.
- Binding a C/C++ library via
dart:ffi+ffigen. - Authoring a plugin, or debugging codec type errors / platform-thread ANRs.
Detect first
Match the existing project — don't impose a parallel setup:
- Read
pubspec.lock: ispigeon(dev) orffigen(dev) present, and which version? Any existingMethodChannel('...')names? - Native: Android
android/.../MainActivity.ktor plugin*Plugin.ktforsetMethodCallHandler; iOSios/Runner/AppDelegate.swiftor*Plugin.swiftforFlutterMethodChannel. - Generated files:
pigeons/*.dart+ generated host/Dart APIs;ffigen.yaml+ generated bindings. - Reuse the existing channel/codec; don't add a parallel stringly-typed channel beside a Pigeon one.