virajp/claude-plugins/flutter-android
Claude Code and agent skill by virajp/claude-plugins
- community
Checking that the SKILL.md file is still in the repository.
The Android-native (Kotlin) edge of a Flutter app — the platform
Install
npx vskill@latest install virajp/claude-plugins/flutter-androidSKILL.md
The same SKILL.md was published earlier as virajp/claude-plugins/flutter-android.
Android Native (Kotlin) via Platform Channels
Use Kotlin only for capabilities Flutter/Dart can't express — Android Auto, app widgets, foreground services, deep OS integrations. Everything crosses the boundary through a MethodChannel; keep the native side a thin dispatcher and push logic back into Dart where you can.
Channel dispatcher
One channel per feature as an object (singleton). Prefer a handler registry keyed by method name so several screens can each register their own methods without overwriting a single monolithic when block:
- Channel name is a reverse-DNS string shared verbatim with the Dart side —
com.app/<feature>. Define it once as a const.
- Each screen calls
registerHandlerin its init andunregisterHandlerin its
cleanup/onDestroy — lifecycle owns the handler, not the channel.
Initialization & Flutter → Native
Bind the channel once when the engine is ready, on the main looper. The dispatcher looks up the handler and falls back to notImplemented():
A handler must call result.success(...) / result.error(...) exactly once.
Native → Flutter
Guard the engine (it may not be up yet), post to the main looper, and surface a not-ready state through the callback rather than crashing:
Engine & registration
Share one cached FlutterEngine (held by the Application) so the channel and the Activity use the same messenger; MainActivity provides it:
Call CarAppChannel.initialize() once from the Application / MainActivity after the engine is created.
Beyond MethodChannel
The hand-written dispatcher above is the default and stays so. A few cases call for a different native entry point — reach for these instead of forcing a channel:
- Pigeon — a type-safe codegen alternative to hand-written channels. Define
the messaging contract once in a Dart schema; Pigeon generates a Kotlin interface (the host API) plus the Dart client, and you implement that generated interface instead of switching on call.method strings. Pick it when the channel surface grows and the string method names get error-prone — the generated interface makes a missing or misnamed method a compile error.
- Platform Views — to embed a native Android
Viewin the Flutter widget
tree, the native side registers a PlatformViewFactory (returning a PlatformView) with the engine's PlatformViewRegistry, from your FlutterPlugin's onAttachedToEngine / configureFlutterEngine. That factory registration is the native-side piece this skill owns; the Dart side hosts it with AndroidView.
- dart:ffi — for a pure C/C++ library,
dart:ffibinds Dart straight to the
native symbols with no platform channel and no Kotlin layer at all. Don't stand up a MethodChannel to wrap C — there's no Kotlin to write.
Conventions
- Argument maps are
Map<String, Any>; cross-boundary types are limited to the
standard message codec (numbers, strings, bools, lists, maps, typed data) — never pass a native object across.
- All channel work runs on the main looper —
MethodChannelis not thread-safe. - Keep parity with the Dart
MethodChannel: method names and channel string
must match exactly on both sides — see the flutter skill's platform interop and build, flavors & signing.
Scope reminder. Kotlin is a platform-edge language here. It exists to answer platform channels and to configure the Android host — not to hold application logic, which belongs in Dart. Gradle files configure native dependencies only; pubspec.yaml is the manifest. See the flutter skill's platform interop.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/stackgen/stacks/app-framework/flutter/skills/flutter-android/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/virajp/claude-plugins/flutter-android)