flutter-native-interop — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited flutter-native-interop (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
dart:ffi library used to bind Dart directly to native C/C++ APIs.MethodChannel, BasicMessageChannel) connecting the Dartclient (UI) to the host platform (Kotlin/Java, Swift/Objective-C, C++).
View, iOS UIView) directly into theFlutter widget tree.
package:web anddart:js_interop.
Use FFI to execute high-performance native code or utilize existing C/C++ libraries without the overhead of asynchronous Platform Channels.
#### Project Setup
package_ffi template. Thisutilizes build.dart hooks to compile native code, eliminating the need for OS-specific build files (CMake, build.gradle, podspec).
flutter create --template=package_ffi <package_name>plugin_ffi template. flutter create --template=plugin_ffi <plugin_name>#### Implementation Rules
extern "C" and prevent linker discarding during link-timeoptimization (LTO).
extern "C" __attribute__((visibility("default"))) __attribute__((used))build.dart hook produces the exact same filename across alltarget architectures (e.g., arm64 vs x86_64) and SDKs (iphoneos vs iphonesimulator). Do not append architecture suffixes to the .dylib or .framework names.
package:ffigen to generate Dart bindings from your C headers (.h). Configure thisin ffigen.yaml.
Use Platform Channels when you need to interact with platform-specific APIs (e.g., Battery, Bluetooth, OS-level services) using the platform's native language.
#### Pigeon (Type-Safe Channels) Always prefer package:pigeon over raw MethodChannel implementations for complex or frequently used APIs.
@HostApi()).#### Threading Rules
thread).
Queue API (makeBackgroundTaskQueue()).
Isolate, ensure it is registered usingBackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken).
Use Platform Views to embed native UI components (e.g., Google Maps, native video players) into the Flutter widget tree.
#### Android Platform Views Evaluate the trade-offs between the two rendering modes and select the appropriate one:
PlatformViewLink +AndroidViewSurface). This appends the native view to the hierarchy but may reduce Flutter's rendering performance.
AndroidView). This rendersthe native view into a texture. Note: Quick scrolling may drop frames, and SurfaceView is problematic.
#### iOS Platform Views
FlutterPlatformViewFactory and FlutterPlatformView in Swift or Objective-C.UiKitView widget on the Dart side.ShaderMask and ColorFiltered widgets cannot be applied to iOS Platform Views.Flutter Web supports compiling to WebAssembly (Wasm) for improved performance and multi-threading.
#### Wasm Compilation
flutter build web --wasm.Cross-Origin-Embedder-Policy: credentialless (or require-corp)Cross-Origin-Opener-Policy: same-originback to JavaScript if WasmGC is unavailable.
#### Web Interop
package:web and dart:js_interop.dart:html, dart:js, or package:js. These are incompatible with Wasm compilation.HtmlElementView.fromTagName to inject arbitrary HTML elements (like <video>) into theFlutter Web DOM.
#### Workflow: Creating a Native FFI Integration Use this workflow when binding to a C/C++ library.
flutter create --template=package_ffi <name>.src/ directory.extern "C" and visibility attributes.ffigen.yaml to point to your header files.dart run ffigen to generate Dart bindings.hook/build.dart if linking against pre-compiled or system libraries.flutter test -> review errors -> fix.#### Workflow: Implementing a Type-Safe Platform Channel (Pigeon) Use this workflow when you need to call Kotlin/Swift APIs from Dart.
pigeon to dev_dependencies.pigeons/messages.dart and define data classes and @HostApi() abstract classes.MainActivity.kt or your Plugin class.AppDelegate.swift or your Plugin class.#### Workflow: Embedding a Native Platform View Use this workflow when embedding a native UI component (e.g., a native map or camera view).
AndroidView (or PlatformViewLink) for Android, andUiKitView for iOS based on defaultTargetPlatform.
PlatformView that returns the native Android View.PlatformViewFactory and register it in configureFlutterEngine.FlutterPlatformView that returns the native UIView.FlutterPlatformViewFactory and register it in application:didFinishLaunchingWithOptions:.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.