Flutter (software)

{{Short description|Open-source UI software development kit for cross-platform applications}}

{{Infobox software

| name = Flutter

| logo = Google-flutter-logo.svg

| logo size =

| author = Google

| developer = Google and community

| released = Alpha (v0.0.6) / {{Start date and age|2017|5|12}}{{cite web |url=https://github.com/flutter/flutter/releases/tag/v0.0.6 |title=Release v0.0.6: Rev alpha branch version to 0.0.6, flutter 0.0.26 (#10010) · flutter/flutter |author=Chris Bracken |website=GitHub |access-date=2018-08-08 |archive-date=2019-02-05 |archive-url=https://web.archive.org/web/20190205055416/https://github.com/flutter/flutter/releases/tag/v0.0.6 |url-status=live }}

| latest release version = {{wikidata|property|preferred|references|edit|Q39072787|P348|P548=Q2804309}}

| latest release date = {{start date and age|{{wikidata|qualifier|preferred|single|Q39072787|P348|P548=Q2804309|P577}}}}

| latest preview version =

| latest preview date = 12/12/2024

| programming language = C, C++, Dart{{cite web |url=https://flutter.dev/faq/ |title=FAQ - Flutter |author= |access-date=2018-08-08 |archive-date=2019-02-23 |archive-url=https://web.archive.org/web/20190223023951/https://flutter.dev/ |url-status=live }}

| platform = Android, iOS, Google Fuchsia, Web platform, Linux, macOS and Windows

| genre = Application framework

| license = New BSD License

| website = {{URL|flutter.dev}}

}}

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,{{Cite web |last=Amadeo |first=Ron |date=2018-02-27 |title=Google starts a push for cross-platform app development with Flutter SDK |url=https://arstechnica.com/gadgets/2018/02/google-starts-a-push-for-cross-platform-app-development-with-flutter-sdk/ |access-date=2021-06-11 |website=Ars Technica |language=en-us |archive-date=2021-10-08 |archive-url=https://web.archive.org/web/20211008235329/https://arstechnica.com/gadgets/2018/02/google-starts-a-push-for-cross-platform-app-development-with-flutter-sdk/ |url-status=live }} Fuchsia, Android, iOS, Linux, macOS, and Windows.{{cite web |last=Amadeo |first=Ron |date=8 May 2017 |title=Google's "Fuchsia" smartphone OS dumps Linux, has a wild new UI |url=https://arstechnica.com/gadgets/2017/05/googles-fuchsia-smartphone-os-dumps-linux-has-a-wild-new-ui/ |access-date=18 March 2018 |publisher=Ars Technica |language=en-US |archive-date=26 September 2019 |archive-url=https://web.archive.org/web/20190926205306/https://arstechnica.com/gadgets/2017/05/googles-fuchsia-smartphone-os-dumps-linux-has-a-wild-new-ui/ |url-status=live }} First described in 2015,{{Cite web |title=With Flutter, Google Aims Dart to Mobile App Cross-Development |url=https://www.infoq.com/news/2015/12/flutter-dart-cross-platform/ |access-date=2022-03-17 |website=InfoQ |language=en |archive-date=2022-04-28 |archive-url=https://web.archive.org/web/20220428184556/https://www.infoq.com/news/2015/12/flutter-dart-cross-platform/ |url-status=live }}{{Cite web |date=2018-12-05 |title=Google announces Flutter 1.0, the first stable release of its cross-platform mobile development toolkit |url=https://www.androidpolice.com/2018/12/05/google-announces-flutter-1-0-the-first-stable-release-of-its-cross-platform-mobile-development-toolkit/ |access-date=2022-03-17 |website=Android Police |language=en-US |archive-date=2022-05-25 |archive-url=https://web.archive.org/web/20220525203749/https://www.androidpolice.com/2018/12/05/google-announces-flutter-1-0-the-first-stable-release-of-its-cross-platform-mobile-development-toolkit/ |url-status=live }} Flutter was released in May 2017. Flutter is used internally by Google in apps such as Google Pay{{cite web |last1=Claburn |first1=Thomas |title=Google's multi-platform app framework Flutter reaches version 2, expands to the web |url=https://www.theregister.com/2021/03/03/google_allinone_app_framework_flutter/ |website=theregister.com |date=3 Mar 2021}}{{cite web|url=https://flutter.dev/showcase/google-pay|title=Going global at Google Pay with Flutter|access-date=2024-04-02|archive-date=2024-03-31|archive-url=https://web.archive.org/web/20240331162532/https://flutter.dev/showcase/google-pay|url-status=live}} and Google Earth{{cite web |last1=Schoon |first1=Ben |title=Google Earth gets a redesigned Android app with Projects support, removes Voyager |url=https://9to5google.com/2023/09/26/google-earth-android-redesign-projects/ |website=9to5google.com |date=September 26, 2023}}{{cite web |url=https://twitter.com/FlutterDev/status/1708908434068779376 |title=Check out the new @googleearth for iOS, Android, and web with UI built using Flutter, all from a single codebase |access-date=2024-04-02 |archive-date=2024-04-02 |archive-url=https://web.archive.org/web/20240402152321/https://twitter.com/FlutterDev/status/1708908434068779376 |url-status=live }} as well as by other software developers including ByteDance{{cite web |last1=Lardinois |first1=Frederic |title=Google's Flutter 3 adds support for macOS and Linux desktop apps |url=https://techcrunch.com/2022/05/11/googles-flutter-3-adds-support-for-macos-and-linux-desktop-apps/ |website=TechCrunch |date=11 May 2022 |quote=On the mobile side, companies like WeChat, ByteDance, Betterment, SHEIN and BMW are now betting on Flutter — as does Google itself.}}{{cite web |url=https://flutter.dev/showcase/bytedance |title=Increasing productivity by 33% at ByteDance with Flutter |access-date=2024-04-02 |archive-date=2024-04-02 |archive-url=https://web.archive.org/web/20240402152323/https://flutter.dev/showcase/bytedance |url-status=live }} and Alibaba.{{cite web |last1=Lardinois |first1=Frederic |title=Google's cross-platform Flutter UI toolkit hits version 1.0 |url=https://techcrunch.com/2018/12/04/googles-cross-platform-flutter-ui-toolkit-hits-version-1-0/ |website=TechCrunch |date=4 December 2018}}{{cite web|url=https://flutter.dev/showcase/alibaba-group|title=Alibaba scales China's largest second-hand marketplace with Flutter|access-date=2024-04-02|archive-date=2024-03-30|archive-url=https://web.archive.org/web/20240330211322/https://flutter.dev/showcase/alibaba-group|url-status=live}}

Flutter ships applications with its own rendering engine which directly outputs pixel data to the screen.{{Cite web |title=Flutter architectural overview |url=https://docs.flutter.dev/resources/architectural-overview |access-date=2024-07-26 |website=docs.flutter.dev |language=en}}{{cite web |last1=Claburn |first1=Thomas |title=Apps made with Google's Flutter may fritter away CPU cycles. Here's what the web giant intends to do about it |url=https://www.theregister.com/2021/11/12/googles_flutter_cpu_performance/ |website=theregister.com |date=12 Nov 2021 |quote=It does so by relying heavily on Skia, a graphics-rendering engine written in C/C++ that uses a device's CPU or GPU to draw app interfaces on its own, without relying on native platform interface libraries.}} This is in contrast to many other UI frameworks that rely on the target platform to provide a rendering engine, such as native Android apps which rely on the device-level Android SDK or IOS SDK which dynamically uses the target platform's built-in UI stack. Flutter's control of its rendering pipeline simplifies multi-platform support as identical UI code can be used for all target platforms.

Architecture

The basic component in a Flutter program is a "widget", which can in turn consist of other widgets.{{cite book |last1=Windmill |first1=Eric |last2=Rischpater |first2=Ray |title=Flutter in action |date=2020 |publisher=Manning Publications Co |location=Shelter Island, NY |isbn=9781617296147 |pages=12,16}} 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. Flutter has 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 setState() method to update an internal state and redraw.{{Cite web |title=Introduction to widgets |url=https://docs.flutter.dev/development/ui/widgets-intro |access-date=2022-10-06 |website=docs.flutter.dev |language=en |archive-date=2022-10-06 |archive-url=https://web.archive.org/web/20221006224251/https://docs.flutter.dev/development/ui/widgets-intro |url-status=live }} 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.{{Cite web |title=Flame |url=https://flame-engine.org/ |access-date=2022-10-06 |website=flame-engine.org |archive-date=2022-09-27 |archive-url=https://web.archive.org/web/20220927120146/https://flame-engine.org/ |url-status=live }}

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.{{cite web |last1=Anderson |first1=Tim |title=Google reports 80% spike of Flutter-built apps in Play Store as 1.20 is released |url=https://www.theregister.com/2020/08/05/google_reports_80_increase_in/ |website=theregister.com |date=5 Aug 2020 |quote=In general the design style follows Google’s Material Design guidelines, making it particularly at home on Android (as you would expect from Google), but there is also support for Cupertino widgets for a native iOS look and feel.}} Flutter allows the developer to use either set of widgets on either platform. Developers can use Cupertino widgets on Android.

Flutter apps are written in the Dart language. Release versions of Flutter apps on all platforms use ahead-of-time (AOT) compilation{{Cite web|url=https://proandroiddev.com/flutters-compilation-patterns-24e139d14177|title=Flutter's Compilation Patterns|last=stephenwzl|date=2018-08-01|website=ProAndroidDev|access-date=2018-12-06|archive-date=2020-06-09|archive-url=https://web.archive.org/web/20200609092357/https://proandroiddev.com/flutters-compilation-patterns-24e139d14177?gi=d859295eb74b|url-status=live}} except for on the Web where code is transpiled to JavaScript or WebAssembly.{{cite web |last1=Lardinois |first1=Frederic |title=Google's Flutter showcases new graphics capabilities, WebAssembly and RISC-V support |url=https://techcrunch.com/2023/01/25/googles-flutter-showcases-new-graphics-capabilities-webassembly-and-risc-v-support/ |website=TechCrunch |date=25 January 2023}}{{Cite web |last=Thomsen |first=Michael |date=2024-05-14 |title=Landing Flutter 3.22 and Dart 3.4 at Google I/O 2024 |url=https://medium.com/flutter/io24-5e211f708a37 |access-date=2024-05-17 |website=Flutter |language=en}} Flutter inherits Dart's [https://pub.dev Pub] package manager and software repository, which allows users to publish and use custom packages as well as Flutter-specific plugins.{{Cite web |title=Using packages |url=https://docs.flutter.dev/development/packages-and-plugins/using-packages |access-date=2022-10-06 |website=docs.flutter.dev |language=en |archive-date=2022-10-06 |archive-url=https://web.archive.org/web/20221006225502/https://docs.flutter.dev/development/packages-and-plugins/using-packages |url-status=live }} 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.{{Cite web|url=https://docs.flutter.dev/flutter/foundation/foundation-library.html|title=foundation library - Dart API|website=docs.flutter.dev|language=en|access-date=2017-12-13|archive-date=2020-06-16|archive-url=https://web.archive.org/web/20200616033708/https://api.flutter.dev/flutter/foundation/foundation-library.html|url-status=live}}

Flutter's engine, written primarily in C++, provides low-level rendering support using either Google's Skia graphics library or the custom "Impeller" graphics layer, which is enabled by default on iOS and is in beta on Android.{{Cite web |title=Flutter architectural overview |url=https://docs.flutter.dev/resources/architectural-overview |access-date=2024-07-26 |website=docs.flutter.dev |language=en}}{{Cite web |title=Impeller rendering engine |url=https://docs.flutter.dev/perf/impeller |access-date=2024-05-17 |website=docs.flutter.dev |language=en}}{{cite web |last1=Bradshaw |first1=Kyle |title=Google releases Flutter 3.7, teases future of app development framework |url=https://9to5google.com/2023/01/25/flutter-forward-teaser/ |website=9to5google.com |date=January 25, 2023}} 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.{{Cite web|url=https://flutter.dev/technical-overview/|title=Technical Overview - Flutter|website=flutter.dev|language=en|access-date=2017-12-13|archive-date=2020-06-16|archive-url=https://web.archive.org/web/20200616033742/https://flutter.dev/docs/resources/technical-overview|url-status=live}}

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.{{cite web |last=Amadeo |first=Ron |date=1 May 2015 |title=Google's Dart language on Android aims for Java-free, 120 FPS apps |url=https://arstechnica.com/gadgets/2015/05/googles-dart-language-on-android-aims-for-java-free-120-fps-apps/ |url-status=live |archive-url=https://web.archive.org/web/20150506182812/https://arstechnica.com/gadgets/2015/05/googles-dart-language-on-android-aims-for-java-free-120-fps-apps/ |archive-date=6 May 2015 |access-date=13 December 2017 |website=Ars Technica |publisher=}} On December 4, 2018, Flutter 1.0 was released at the Flutter conference in London.{{cite web |last1=Amadeo |first1=Ron |title=Google bridges Android and iOS development with Flutter 1.0 |url=https://arstechnica.com/gadgets/2018/12/google-bridges-android-and-ios-development-with-flutter-1-0/ |website=Ars Technica |language=en-us |date=4 December 2018}}

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.{{cite web |last1=Siddiqui |first1=Aamir |title=Google releases Flutter 1.17 and Dart 2.8 stable SDKs for app development |url=https://www.xda-developers.com/google-flutter-117-dart-2-8-stable-sdk-app-development/ |website=XDA |language=en |date=6 May 2020 |quote=Flutter now uses Metal by default when building for supported iOS devices, making Flutter apps run faster.}}

On March 3, 2021, Google released Flutter 2 during an online Flutter Engage event.{{cite web |last1=Lardinois |first1=Frederic |title=Version 2 of Google's Flutter toolkit adds support for desktop and web apps |url=https://techcrunch.com/2021/03/03/version-2-of-googles-flutter-toolkit-adds-support-for-desktop-and-web-apps/ |website=TechCrunch |date=3 March 2021}} It added a Canvas-based renderer for web in addition to the HTML-based renderer and early-access desktop application support for Windows, macOS, and Linux. It also shipped with Dart 2.0 which included support for null-safety.{{cite web |last1=Wander |first1=Zachary |title=Dart 2.12 has been released, with null-safety and C interoperability |url=https://www.xda-developers.com/dart-2-12-release/ |website=XDA |language=en |date=3 March 2021}} Null safety was initially optional as it was a breaking change and was made mandatory in Dart 3 released in 2023.{{cite web |last1=Claburn |first1=Thomas |title=Google's Dart language soon won't take null for an answer |url=https://www.theregister.com/2022/12/09/google_dart_null_safety/ |website=theregister.com |date=9 Dec 2022}}

On May 12, 2022, Flutter 3 and Dart 2.17 were released with support for all desktop platforms as stable.{{cite web |last1=Claburn |first1=Thomas |title=Google's Flutter app development framework now stable across platforms |url=https://www.theregister.com/2022/05/11/google_io_flutter_crossplatform_app/ |website=theregister.com |date=11 May 2022}}

On October 27, 2024, a number of Flutter community developers announced Flock, a fork of Flutter intended to be easier to contribute to while still keeping in sync with all changes made in the upstream code base.{{cite web |url=https://www.phoronix.com/news/Google-Flutter-UI-Flock-Fork |title=Google's Flutter UI Toolkit Forked As Flock |last1=Larabel |first1=Michael |date=29 October 2024 |access-date=30 October 2024 |website=phoronix.com}}{{cite web |last1=Krill |first1=Paul |title=Google's Flutter framework has been forked |url=https://www.infoworld.com/article/3595687/googles-flutter-framework-has-been-forked.html |website=InfoWorld}}

See also

References