Flutter (software)

Flutter is an open-source UI software development kit created by Google. It can be used to develop cross platform applications from a single codebase for the web, Fuchsia, Android, iOS, Linux, macOS, and Windows. First described in 2015, Flutter was released in May 2017. Flutter is used internally by Google in apps such as Google Pay and Google Earth as well as by other software developers including ByteDance and Alibaba.

Flutter consists of both a UI language and a rendering engine. When a Flutter application is compiled, it ships with both the UI code and the rendering engine, which is about 4 MB compressed. This is in contrast to many other UI frameworks that rely on a separate rendering engine and only ship the UI code, such as native Android apps which rely on the device-level Android SDK or HTML/JavaScript Web apps that rely on the user's HTML engine and JavaScript engine. Flutter's complete control of its rendering pipeline makes supporting multiple platforms simpler as it only needs the platform to support running native code such as via the Android Java Native Interface rather than support Flutter's UI model in its entirety.

History
The first version of Flutter was known as "Sky" and ran on the Android operating system. It was unveiled at the 2015 Dart developer summit with the stated intent of being able to render consistently at 120 frames per second. During the keynote of Google Developer Days in Shanghai in September 2018, Google announced Flutter Release Preview 2. On December 4, 2018, Flutter 1.0 was released at the Flutter Live event. On December 11, 2019, Flutter 1.12 was released at the Flutter Interactive event.

On May 6, 2020, the Dart software development kit (SDK) version 2.8 and Flutter 1.17.0 were released, adding support for the Metal API as well as new Material widgets and network tracking development tools.

On March 3, 2021, Google released Flutter 2 during an online Flutter Engage event. It added a Canvas Kit renderer for web as opposed to the HTML version before it, web specific widgets, early-access desktop application support for Windows, macOS, and Linux and improved Add-to-App APIs. It also shipped with Dart 2.0 which included partial null-safety, which caused many breaking changes and issues with many external packages; however, the Flutter team included instructions and tools to mitigate these issues.

On September 8, 2021, Dart 2.14 and Flutter 2.5 were released with the latest version of Material Design called Material You.

On May 12, 2022, Flutter 3 and Dart 2.17 were released with support for all desktop platforms as stable.

Widgets
The basic component in a Flutter program is a "widget", which can in turn consist of other widgets. A widget describes the logic, interaction, and design of a UI element with an implementation similar to React. Unlike other cross-platform toolkits such as React Native and Xamarin which draw widgets using native platform components, Flutter renders widgets itself on a per-pixel basis.

There are two types of widgets: stateless and stateful. Stateless widgets only update if their inputs change, meaning they otherwise won't need to be rebuilt when other elements of the screen change, while stateful widgets can call the  method to update an internal state and redraw.

Although widgets are the primary method of constructing Flutter applications, they can also be bypassed in favor of directly drawing on a canvas. This feature has been occasionally used to implement game engines in Flutter.

Dart language
Flutter apps are written in the Dart language. Release versions of Flutter apps on all platforms use ahead-of-time (AOT) compilation except for on the Web where code is transpiled to JavaScript or WebAssembly.

Flutter inherits Dart's Pub package manager and software repository, which allows users to publish and use custom packages as well as Flutter-specific plugins.

Flutter engine
Flutter supports two different rendering engines: Google's Skia graphics library and Flutter's own engine called Impeller. Impeller is enabled by default on iOS and is currently in beta on Android. The engine interfaces with platform-specific SDKs such as those provided by Android and iOS to implement features like accessibility, file and network I/O, native plugin support, etc.

Foundation library
The Foundation library, written in Dart, provides basic classes and functions that are used to construct applications using Flutter, such as APIs to communicate with the engine.

Design-specific widgets
The Flutter framework contains two sets of widgets that conform to specific design languages: Material Design widgets implement Google's design language of the same name, and Cupertino widgets implement Apple's iOS Human interface guidelines. Flutter allows the developer to use either set of widgets on either platform. Developers can use Cupertino widgets on Android. Third party packages can be used to automatically adjust the app's design to the current operating system.