Flutter University
  • πŸ‘‹Welcome to Flutter University
  • Learn Flutter
    • πŸš—Basics
      • 🧺Dart Basics
      • πŸš›Setup & Installation
      • 🐣Hello Flutter
      • πŸŒ‰Widgets
      • ⛸️Basic State Management
      • πŸ‡ΎπŸ‡ΉBasic Layout and Styling
      • 🐝Basic Interactivity
      • πŸ›£οΈNavigation
      • πŸͺ„Working with Assets
    • πŸš…Intermediate
      • 🎯Deeper into Dart
      • ⭐More on State Management
      • πŸ“ƒForm Handling
      • πŸ—ΌNetworking
      • πŸŽ‡Persistence
      • πŸ§™β€β™‚οΈAnimations
      • πŸ§ͺTesting
      • πŸ“¦Package Management
    • ✈️Professional
      • πŸŽ“Advanced Animations
      • 🎨Custom Painters
      • 🐼Continuous Integration/Continuous Deployment (CI/CD)
      • 🎭Performance Profiling
      • πŸ”¬Native Integrations
      • 🌍Accessibility and Localization
      • 🀘Understanding Design Patterns
      • πŸ“šFlutter Architecture
        • The Layer Model
        • Reactive User Interfaces
        • Flutter Widgets
        • The Rendering Process
        • Platform Embedders Overview
        • Integrating with Other Code
        • Support for the Web
  • Tutorials
    • 🌈UI
      • 🏚️Clubhouse Clone
      • πŸ”‰Netflix Clone
    • βš”οΈFull Stack
    • ⛓️Blockchain
    • πŸ€–AI/ML
  • Miscellaneous
    • πŸ–₯️100 Days of Flutter
    • 🎨Join Community
Powered by GitBook
On this page
  • How Does It Work on Different Platforms?
  • Custom Platform Embedders
  • Key Takeaways

Was this helpful?

  1. Learn Flutter
  2. Professional
  3. Flutter Architecture

Platform Embedders Overview

Last updated 1 year ago

Was this helpful?

At its core, platform embedding is about how Flutter interacts with the underlying operating system to display your app and handle its lifecycle. Unlike other frameworks that might convert UI elements into the operating system's widgets, Flutter does all the UI rendering itself.

This means Flutter needs a way to communicate with the host operating system to display its content, process user inputs, and manage app states. That's where platform embedding comes into play.

The platform embedder is essentially a bridge between Flutter and the native OS. It's responsible for initializing the Flutter engine, which runs your app, and creating a window or a texture where Flutter can draw its UI. This setup allows your Flutter app to run on Android, iOS, Windows, macOS, and Linux.

How Does It Work on Different Platforms?

Android and iOS

On Android, Flutter typically runs inside an Activity as a . This FlutterView is where your Flutter UI is rendered. It can work as a view or a texture, based on your app's needs. For iOS, Flutter uses a UIViewController to integrate with the system. Both platforms use their respective APIs to handle app lifecycle events, input gestures, and other system services.

Desktop (Windows, macOS, Linux)

For desktop platforms, Flutter integrates differently. On Windows, it's hosted in a traditional Win32 application, with content rendered using to translate OpenGL calls to DirectX. macOS uses an NSViewController for integration, while Linux details can vary based on the specific setup.

Custom Platform Embedders

One of the powerful features of Flutter is the ability to create custom platform embedders (). This means if the default embedders don't meet your needs, you can build your own. Examples include creating an embedder for a Raspberry Pi or for systems that support VNC-style remote sessions.

Key Takeaways

  • Platform embedding in Flutter is how the framework communicates with the host operating system to display your app and handle its lifecycle.

  • Flutter comes with platform embedders for major operating systems, including Android, iOS, Windows, macOS, and Linux.

  • You can also create custom platform embedders to fit your specific requirements, offering great flexibility for developers.

✈️
πŸ“š
FlutterView
ANGLE
checkout