This article is more than 1 year old

Google's multi-platform app framework Flutter reaches version 2, expands to the web

The same tech inside Google Pay, Shopping, Analytics, Ads, etc

Google on Wednesday announced the release of Flutter 2, an update to its popular cross-platform, open source app development framework.

The software revision, announced in conjunction with a virtual event called Flutter Engage, is accompanied by the release of version 2.12 of the Dart programming language, which Flutter relies on. Its most notable feature is the addition of sound null safety, a way to ensure that errors triggered by undefined values can be avoided.

Flutter allows developers to create a single code base that can generate apps for Android, iOS, Windows, macOS, and Linux, the web, and embedded devices, though desktop OS support isn't stable yet.

"The big marquee feature news for us is this broadening out from Flutter being a primarily a mobile platform to now being truly portable across mobile, desktop, the web and embedded," said Tim Sneath, director of product management for Flutter and Dart, in an interview with The Register.

The new release makes web builds available via Flutter's stable channel, meaning it's ready for usage in production.

"This is big news for us," said Sneath. "It's exciting to see the pace with which people have adopted Flutter. We have over 150,000 apps now in the Play Store alone."

Google is also releasing a beta version of Google Mobile Ads for Flutter, a SDK for integrating the company's AdMob and AdManager into Flutter apps, as well as Flutter plugins for various Firebase services, including Authentication, Cloud Firestore, Cloud Functions, Cloud Messaging, Cloud Storage and Crashlytics. The plugins implement support for Dart's sound null safety.

Google has been eating its own dog food, so to speak: its apps for Google One, Google Pay, Nest Hub, Stadia, Family Link, Google Ads, Google Shopping, Google Analytics, Cloud Search, and Google AdMob all rely on Flutter.

According to the company, Google Pay switched to Flutter a few months ago and the engineering team was able to get rid of half a million lines of code tied to features for specific platforms.

Flutter is also gaining traction at other companies. At Flutter Engage, Canonical is expected to show off a new Ubuntu installer app built with Flutter. And Microsoft is planning to add code contributions to the Flutter engine to support foldable Android devices.

One of the criticisms of Flutter for the web, at least during the beta stage, was that Flutter web apps are more like Flash files than traditional HTML, CSS, and JavaScript. That's because they're displayed via Flutter's CanvasKit, which uses Skia graphics compiled to WebAssembly and rendered using WebGL. The result is not human-readable code that can be scrutinized via the browser's View Page Source command.

"We use Canvas kit," said Sneath. "That's part of the modern web platform. It gives us a lot of flexibility for building the level of performance that people look for from a web page."

Sneath argues that when people build modern web apps (PWAs and SPAs), they often aren't planning to make the source code readable.

"If I go to Facebook or Twitter or Google Docs or Gmail, you know, those are not the kinds of experiences where it's even helpful to be able to parse through the code," he said. "Typically the web code is minified for performance reasons. It's not designed for human enhancement."

Typically the web code is minified for performance reasons. It's not designed for human enhancement

But he said Flutter does offer another web rendering option, the HTML renderer. "We also have a second mode for the web, which is designed for those kinds of scenarios where you really do want more of the ability to see everything that's going on behind the scenes," he said.

Game developers won't find much to convince them to adopt Flutter. Sneath said the Flutter team hasn't focused specifically on gaming but noted that there are more casual games being developed with the framework. He suggested the Google Mobile Ads for Flutter SDK might help encourage more experimentation among game developers by providing a monetization option.

Asked whether Flutter might ever be modified to work with programming languages other than Dart, Sneath went all in on Dart.

"Dart is the secret sauce of flutter," he said. "Everything that we build here comes from the creative technical envelope that allows the needs of an app framework like this to flourish. The thing that is particularly beneficial about Dart is the fact that it compiles to JavaScript, and to native code, across, Intel, Arm, [and other hardware architectures]."

"Ecosystems are slow to build," he said. "They take a while for people to build all the packages and frameworks and other pieces associated with that. These things don't happen overnight. But Dart is one of the fastest growing programming languages out there, propelled in large part by that."

Sneath said that based on pull requests at GitHub during the last quarter, Dart has been growing faster than almost any other language, including Swift and Rust. ®

More about

TIP US OFF

Send us news


Other stories you might like