flutter-native-interop

Installation
SKILL.md

Flutter Platform Integration

Goal

Integrates Flutter applications with platform-specific code and native features across Android, iOS, and Web environments. Determines the optimal interoperability strategy (FFI, Platform Channels, Platform Views, or JS Interop) and implements the necessary Dart and native code bindings while adhering to thread safety, WebAssembly (Wasm) compatibility, and modern build hook standards.

Instructions

1. Determine Integration Strategy (Decision Logic)

Evaluate the user's requirements using the following decision tree to select the correct integration path:

  • Scenario A: Calling native C/C++ code.
    • Action: Use dart:ffi with the package_ffi template and build hooks.
    • Exception: If accessing the Flutter Plugin API or requiring static linking on iOS, use the legacy plugin_ffi template.
  • Scenario B: Calling OS-specific APIs (Java/Kotlin for Android, Swift/Obj-C for iOS).
    • Action: Use Platform Channels (MethodChannel) or the pigeon package for type-safe code generation.
  • Scenario C: Embedding native UI components into the Flutter widget tree.
    • Action: Use Platform Views (AndroidView / AndroidViewSurface for Android, UiKitView for iOS).
  • Scenario D: Web integration and JavaScript APIs.
    • Action: Use package:web and dart:js_interop (Wasm-compatible). Use HtmlElementView for embedding web content.
Installs
974
Repository
flutter/skills
GitHub Stars
2.4K
First Seen
Mar 4, 2026
flutter-native-interop — flutter/skills