Accessibility & localization
Platform Integration
Flutter architecture
Flutter is a cross-platform UI toolkit that is designed to allow code reuse across operating systems such as iOS and Android, while also allowing applications to interface directly with underlying platform services.
- During development, Flutter apps run in a VM that offers stateful hot reload of changes without needing a full recompile.
- For release, Flutter apps are compiled directly to machine code, whether Intel x64 or ARM instructions, or to JavaScript if targeting the web.
Flutter is designed as an extensible, layered system. It exists as a series of independent libraries that each depend on the underlying layer. No layer has privileged access to the layer below, and every part of the framework level is designed to be optional and replaceable.
Just like any other native application, Flutter is packaged with three layers:
- Framework (highest layer): The framework layer is the part where most developers can interact with Flutter. The Flutter framework provides a reactive and modern framework that is written in Dart.
- It comprises of Rendering, Widgets, Material and Cupertino.
- It also has foundational classes and building block services like animation, drawing, and gestures, which are required for writing a Flutter application.
- Engine: The engine layer is written in C/C++, and it takes care of the input, output, network requests, and handles the difficult translation of rendering whenever a frame needs to be painted.
- Flutter uses Skia/Impeller as its rendering engine (turns UI code into pixels) and it is revealed to the Flutter framework through the
dart : ui
, which wraps the principal C++ code in Dart classes.
- Embedder (lowest layer, contains the code that lets mobile and desktop OSes execute Flutter apps): An entry point is provided by a platform-specific embedder, which coordinates with the underlying operating system to access services such as accessibility, rendering surfaces, and input.
- The embedder is written in a platform-specific language, such as Java and C++ for Android, Objective-C/Objective-C++ for iOS and macOS, and C++ for Windows and Linux.
- Flutter code can be embedded into an existing application as a module or as the complete application’s content using the embedder.
