flutter-embedding-native-views
Embed native Android, iOS, or macOS views and web content directly into Flutter applications.
- Supports two Android composition modes (Hybrid and Texture Layer) with distinct performance and fidelity tradeoffs; iOS and macOS use Hybrid Composition exclusively
- Includes step-by-step workflows for implementing platform views on Android and iOS, with validation and troubleshooting guidance
- Enables embedding Flutter into existing web applications via Full Page or Multi-view (Embedded) mode, with JavaScript and Dart configuration examples
- Provides performance mitigation strategies, such as rendering native view screenshots as placeholder textures during complex animations
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.
More from flutter/skills
flutter-building-layouts
Builds Flutter layouts using the constraint system and layout widgets. Use when creating or refining the UI structure of a Flutter application.
10.6Kflutter-architecting-apps
Architects a Flutter application using the recommended layered approach (UI, Logic, Data). Use when structuring a new project or refactoring for scalability.
10.4Kflutter-animating-apps
Implements animated effects, transitions, and motion in a Flutter app. Use when adding visual feedback, shared element transitions, or physics-based animations.
9.6Kflutter-managing-state
Manages application and ephemeral state in a Flutter app. Use when sharing data between widgets or handling complex UI state transitions.
9.6Kflutter-theming-apps
Customizes the visual appearance of a Flutter app using the theming system. Use when defining global styles, colors, or typography for an application.
9.5Kflutter-implementing-navigation-and-routing
Handles routing, navigation, and deep linking in a Flutter application. Use when moving between screens or setting up URL-based navigation.
9.3K