移动开发

flutter-platform-views

flutter/agent-plugins

Add a native view into your Flutter app

  • 951 次安装
  • 3100 星标
  • 收录于

安装命令

npx skills add https://github.com/flutter/agent-plugins --skill flutter-platform-views

SKILL.md

flutter-platform-views-and-web-embedding

Goal

Guides developers through implementing Flutter Platform Views for Android, iOS, and macOS, as well as embedding Flutter into existing web applications. Assumes the user has a configured Flutter environment and is comfortable with Dart, JavaScript, and the relevant native platform languages (Kotlin, Swift).

Instructions

1. Determine the Target Platform and Embedding Strategy (Decision Logic)

Before writing code, you must determine the target platform and the specific embedding strategy required by the user.

STOP AND ASK THE USER: "Which platform are you targeting for native view embedding?

  1. Android (Requires choosing between Hybrid Composition or Texture Layer)
  2. iOS (Hybrid Composition only)
  3. macOS (Hybrid Composition only, gesture support limited)
  4. Web (Requires choosing between Full Page mode or Embedded/Multi-view mode)"

Decision Tree:

  • If Android: Ask the user: "Do you prioritize native Android view fidelity (Hybrid Composition) or Flutter rendering performance (Texture Layer)?"
  • If Web: Ask the user: "Are you taking over the full page, or embedding Flutter into specific HTML elements (Embedded/Multi-view mode)?"