Technical & DevelopmentIntermediate
flutter-embedding-native-views
Embed native Android, iOS, and macOS views in Flutter widgets
Developer Setup
Setup & Installation
bash
npx skills add https://github.com/flutter/skills --skill flutter-embedding-native-viewsnpx skills add https://github.com/flutter/skills --skill flutter-embedding-native-viewsOr paste this URL into your assistant to install:
Overview
What This Skill Does
Embed native Android, iOS, and macOS views in Flutter widgets
Application
When to use this Skill
- Integrating flutter embedding native views into your development workflow.
- Following best practices for embed native android, ios, and macos views in flutter widgets.
- Automating repetitive tasks with AI-assisted tooling.
- Building production-grade applications with proper standards.
- Debugging and troubleshooting common implementation issues.
Documentation
Show Skills.md file
Integrating Platform Views and Web Content
Contents
- Platform Views Architecture
- Web Embedding Architecture
- Workflow: Implementing Android Platform Views
- Workflow: Implementing iOS Platform Views
- Workflow: Embedding Flutter in Web Applications
- Examples
Platform Views Architecture
Platform Views allow embedding native views (Android, iOS, macOS) directly into a Flutter application, enabling the application of transforms, clips, and opacity from Dart.
Android Implementations (API 23+)
Choose the appropriate implementation based on your performance and fidelity requirements:
- Hybrid Composition: Renders Flutter content into a texture and uses
SurfaceFlingerto compose both.- Pros: Best performance and fidelity for Android views.
- Cons: Lowers overall application FPS. Certain Flutter widget transformations will not work.
- Texture Layer (Texture Layer Hybrid Composition): Renders Platform Views into a texture. Flutter draws them via the texture and renders its own content directly into a Surface.
- Pros: Best performance for Flutter rendering. All transformations work correctly.
- Cons: Quick scrolling (e.g., WebViews) can be janky.
SurfaceViewis problematic (breaks accessibility). Text magnifiers break unless Flutter is rendered into aTextureView.
iOS & macOS Implementations
- iOS: Uses Hybrid Composition exclusively. The native
UIViewis appended to the view hierarchy.
Lines 1 - 25 of 189
Recommendations