flutter-interoperating-with-native-apis

flutter-interoperating-with-native-apis is a skill for Claude Code, Codex from mdazadhossain95/flutter-agent-skills. It costs 42 tokens per session (1,986 once invoked), scanned A, original, MIT.

Integration guidance for connecting Flutter code with Android, iOS, web, C, C++, and JavaScript code. It covers platform channels, direct C and C++ bindings, embedded native views, and web interoperability.

In plain words
What is it for?
Use it to call Kotlin, Java, Swift, Objective-C, C, C++, JavaScript, or web APIs, and to place native Android or iOS interface components inside a Flutter widget tree.
Why use it?
It helps when a Flutter app needs device-specific features or existing native code that is not available directly in Dart.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to call Kotlin, Java, Swift, Objective-C, C, C++, JavaScript, or web APIs, and to place native Android or iOS interface components inside a Flutter widget tree.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mdazadhossain95/flutter-agent-skills --skill flutter-interoperating-with-native-apis
Clone the repo
git clone --depth 1 https://github.com/mdazadhossain95/flutter-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for flutter-interoperating-with-native-apis

README.md
[![agentmods](https://agentmods.dev/badge/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis/github.svg)](https://agentmods.dev/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis)
Your own site
<a href="https://agentmods.dev/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis"><img src="https://agentmods.dev/badge/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for flutter-interoperating-with-native-apis

Your own site · 80×15
<a href="https://agentmods.dev/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis"><img src="https://agentmods.dev/badge/skills/mdazadhossain95/flutter-agent-skills/flutter-interoperating-with-native-apis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,986 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01986
Opus 5 $0.00021 $0.00993
Sonnet 5 $0.00008 $0.00397
Haiku 4.5 $0.00004 $0.00199

Measured 9d ago against content hash ee9462b6af0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

flutter-interoperating-with-native-apis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/flutter-interoperating-with-native-apis/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Integrating Platform-Specific Code in Flutter

Contents

Core Concepts & Terminology

  • FFI (Foreign Function Interface): The dart:ffi library used to bind Dart directly to native C/C++ APIs.
  • Platform Channel: The asynchronous message-passing system (MethodChannel, BasicMessageChannel) connecting the Dart client (UI) to the host platform (Kotlin/Java, Swift/Objective-C, C++).
  • Pigeon: A code-generation tool that creates type-safe Platform Channels.
  • Platform View: A mechanism to embed native UI components (e.g., Android View, iOS UIView) directly into the Flutter widget tree.
  • JS Interop: The modern, Wasm-compatible approach to interacting with JavaScript and DOM APIs using package:web and dart:js_interop.

Binding to Native C/C++ Code (FFI)

Use FFI to execute high-performance native code or utilize existing C/C++ libraries without the overhead of asynchronous Platform Channels.

Project Setup

  • If creating a standard C/C++ integration (Recommended since Flutter 3.38): Use the package_ffi template. This utilizes 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>
    
  • If requiring access to the Flutter Plugin API or Play Services: Use the legacy plugin_ffi template.
    flutter create --template=plugin_ffi <plugin_name>
    

Implementation Rules

  • Symbol Visibility: Always mark C++ symbols with extern "C" and prevent linker discarding during link-time optimization (LTO).
    extern "C" __attribute__((visibility("default"))) __attribute__((used))
    
  • Dynamic Library Naming (Apple Platforms): Ensure your build.dart hook produces the exact same filename across all target architectures (e.g., arm64 vs x86_64) and SDKs (iphoneos vs iphonesimulator). Do not append architecture suffixes to the .dylib or .framework names.
  • Binding Generation: Always use package:ffigen to generate Dart bindings from your C headers (.h). Configure this in ffigen.yaml.

Read the full file on GitHub · 128 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 128 lines · 42 tokens per session scan A ee9462b6af0c

Subscribe to this mod's changes

flutter-interoperating-with-native-apis is a skill published in the GitHub repository mdazadhossain95/flutter-agent-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 42 tokens to every session and 1,986 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories