skills.vishalvoidskills/vishalvoid
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-views

Overview

What This Skill Does

Embed native Android, iOS, and macOS views in Flutter widgets

Application

When to use this Skill

Documentation

Show Skills.md file

Integrating Platform Views and Web Content

Contents

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 SurfaceFlinger to 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. SurfaceView is problematic (breaks accessibility). Text magnifiers break unless Flutter is rendered into a TextureView.

iOS & macOS Implementations

  • iOS: Uses Hybrid Composition exclusively. The native UIView is appended to the view hierarchy.
Lines 1 - 25 of 189

Recommendations

Explore other random skills

All skillsMy patterns