skills.vishalvoidskills/vishalvoid
Creative & DesignBeginner

flutter-building-plugins

Create Flutter plugins that bridge Dart with platform code

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/flutter/skills --skill flutter-building-plugins

Overview

What This Skill Does

Create Flutter plugins that bridge Dart with platform code

Application

When to use this Skill

Documentation

Show Skills.md file

Developing Flutter Plugins

Contents

Architecture & Design Patterns

Federated Plugins

Implement federated plugins to split a plugin's API across multiple packages, allowing independent teams to build platform-specific implementations. Structure federated plugins into three distinct components:

  1. App-facing interface: The primary package users depend on. It exports the public API.
  2. Platform interface: The package defining the common interface that all platform implementations must implement.
  3. Platform implementations: Independent packages containing platform-specific code (e.g., my_plugin_android, my_plugin_windows).

FFI vs. Standard Plugins

Choose the correct plugin template based on your native interoperability requirements:

  • Standard Plugins (--template=plugin): Use for accessing platform-specific APIs (e.g., Android SDK, iOS frameworks) via Method Channels.
  • FFI Plugins (--template=plugin_ffi): Use for accessing C/C++ native libraries, configuring Google Play services on Android, or using static linking on iOS/macOS.
    • Constraint: FFI plugin packages support bundling native code and method channel registration code, but not method channels themselves. If you require both method channels and FFI, use the standard non-FFI plugin template.

Workflow: Creating a New Plugin

Lines 1 - 25 of 198

Recommendations

Explore other random skills

All skillsMy patterns