skills/flutter/flutter-native/SKILL.md
Build type-safe native platform integrations using MethodChannels, EventChannels, and Pigeon. Use when communicating with Android/iOS native code, implementing federated plugins, or bridging platform-specific APIs.
npx skillsauth add dhruvanbhalara/skills flutter-nativeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Developing Flutter apps often requires direct communication with the underlying native platform (Android/iOS). This skill covers the standards for maintainable and type-safe interoperability.
Use MethodChannel for standard request-response patterns between Dart and Native.
PlatformException.static const _channel = MethodChannel('com.example.app/device_info');
Future<String?> getDeviceOS() async {
try {
return await _channel.invokeMethod<String>('getOS');
} on PlatformException catch (e) {
AppLogger.error('Failed to get OS', error: e);
return null;
}
}
Use EventChannel for continuous data flow (e.g., sensor data, connectivity).
onListen and onCancel.For complex APIs, avoid manual string-based keys. Use Pigeon to generate type-safe interfaces.
Organize native code within the relevant feature if possible, or use a dedicated plugins/ directory for shared logic.
If the logic is reusable across multiple apps:
_platform_interface, _android, _ios, and _web packages.development
Perform REST API networking operations (GET, POST, PUT, DELETE) using the lightweight and robust standard `http` package, including platform configurations and background parsing models.
development
Configure internationalization and localization support using Flutter's built-in l10n system, App Resource Bundle (ARB) files, and ICU formatting syntax.
development
Create model classes with fromJson/toJson using dart:convert and Dart 3 pattern matching. Use when manually mapping JSON to classes, parsing HTTP responses, or choosing between manual and code-generated serialization.
data-ai
Diagnose and fix Flutter layout constraint violations (RenderFlex overflow, unbounded height/width, ParentData misuse). Use when encountering layout exceptions, yellow-black overflow stripes, or red error screens.