Google's Flutter app development framework now stable across platforms

v3.0 has also gained a Casual Games Toolkit

Google I/O Google's Flutter development framework finally achieved its cross-platform aspirations with a stable release of Linux and macOS support.

Flutter 3.0, announced at Google's I/O developer conference, provides developers with a way to write apps for the six major consumer-facing platform targets using the Dart programming language. And that's not to mention embedded devices.

"With Flutter 2.0, we shipped web support, and just recently we shipped support for Windows," said Tim Sneath, director of product and user experience for Flutter and Dart, in an interview with The Register.

"And now with Flutter 3.0, we finally reached the point where we have completed that journey. We have all of the six major platforms – iOS, Android, web, Windows, macOS, Linux – all supported as stable parts of the Flutter framework."

For macOS, that means Intel and Apple Silicon support, via Universal Binary builds, as well as Apple Silicon support in development. Thanks to Dart's support for Apple Silicon, compilation is faster.

Support for Linux and macOS was previously considered to be in beta and thus not particularly suitable for production apps.

Now, with Google's Material Design 3 mostly complete, those looking to build cross-platform UIs in the Android idiom can rely on an aesthetically coherent toolkit.

Flutter 3.0 is accompanied by a Dart version bump to 2.17, which incorporates new language features that purportedly reduce boilerplate and aid readability.

If you've ever seen a Dart code "pyramid of doom" take shape in a Flutter app, that's likely to be a welcome improvement.

One such addition – super parameters, a succinct way to specify that a parameter belongs to a superclass – saved 2,000 lines of code when merged.

The Dart language update also includes experimental RISC-V support, a better linter, and improved documentation.

Google has coupled Flutter more tightly to its Firebase cloud database service, so Firebase support for Flutter will move in parallel with support for Android and iOS. This should reduce breaking changes and inconsistencies. What's more, Firebase's real-time crash reporting service, Crashlytics, has better Flutter support through the Flutter Crashlytics plugin.

'23,000 packages' in the Flutter ecosystem

Asked about the relatively small number of packages available to Flutter developers, Sneath said the Flutter community has been stepping up to fill the gap, individually and at a corporate level.

"Companies like Microsoft and Amazon are writing plugins, and communities are starting to band together and pool their resources around common packages that others use or want to see," he said. "We have over 23,000 packages now in the Flutter ecosystem and that's growing quickly, both in number and the quality of those packages."

Arguably the most significant aspect of the 3.0 release is Google's decision to support casual game development via its Casual Games Toolkit, a selection of templates and best practices, plus credits for ads and cloud services.

Google's Flutter team has not previously tried to meet the needs of game developers, though some efforts along those lines have been made by third parties, most notably via the Flame game engine, which reached its 1.0 milestone last December.

Sneath said Flame is aimed at a more demanding sort of game than the Casual Games Toolkit.

"A lot of what we're trying to offer in the Casual Games Toolkit is supplementary to Flame," he said, pointing to tasks like integrating with Apple's Game Center or Google Play games services.

"Game developers might be interested in things like microtransactions or in-app purchases," explained Sneath. "They might need splash screens, leaderboards and things like that. So a lot of what we're doing is trying to provide those pieces that sit around the core game engine and leave the amazing Flame folk to be able to continue to build that core game engine out."

To provide a sense of Flutter's potential as a game framework, Google has developed a Flutter web pinball game as a demo. It won't blow you away with super-realistic ball physics or astonish you by pushing the boundaries of browser-based gaming, but it's a passable pinball simulation and may serve to convince aspiring indie game devs to use Flutter to create the next Wordle.

Gaming might seem an odd fit for Flutter given that its early adopters appear to be large developers of commercial apps and enterprises that have favored cross-platform development as a way to avoid maintaining multiple native platform codebases.

Sneath suggested that game development and enterprise development share a common concern for performance and user experience and that the Flutter team's ongoing effort to iron out rough spots like interface jank ultimately make the framework better for any sort of application.

"The changes we've made to Flutter are not specifically around game development, but we've continued to work on performance, and maximizing the tools that developers have to track performance issues, whether they're in their code, or whether they're hitting, you know, issues elsewhere," he said. "We continue to work on those things that make every app better whether it's a game or a traditional application."

Sneath said there are now over 500,000 apps built using Flutter, double the number available during Google I/O last year.

He pointed to Chinese tech firm ByteDance as a major user of the development framework, estimating that they have about 80 Flutter-based apps. The company last month published a YouTube testimonial about its adoption of Flutter.

"They are truly leading into this multi-platform story," said Sneath. "They're able to unify their skills. They're able to unify their development, infrastructure and model and reach all of these different platforms."

'Not oversold,' say Sonos devs

Cross-platform development has always involved trade-offs and isn't right for every app. While Apple, eager to have developers pay to write native platform code that takes advantage of hardware innovations, has disparaged cross-platform frameworks like Adobe Flash for producing lowest-common-denominator apps, the benefits and drawbacks of using a framework like Flutter over native platform code tend to be more subtle and aren't always obvious prior to app completion.

Sonos, for example, is using Flutter for its iOS and Android apps and last week penned a summary of its experience.

The Sonos development team considered developing their apps in native code, in React (a popular web front-end framework), and in Flutter, eventually settling on Google's open-source framework.

"We were sold on Flutter's visuals, and can happily attest we were not one bit oversold," wrote senior software engineers Patrick Celentano and Shih-Chang Hsiung.

"Implementing our designers' vision was finally possible – and on more than a few occasions, developers have been able to suggest solutions designers wouldn't have dreamed possible. Flutter's API is well-designed, and its widget hierarchy sturdy."

The Sonos developers are careful to note that Flutter does have shortcomings. They found integrating Flutter into their app's unique build process difficult and noted that while release build performance has been respectable – something Google's engineers have been working on – debug mode proved slow during development and the framework lacked certain desired features and had undesired bugs.

"While the Flutter framework is by no means perfect, it is not an exaggeration to say that it has unlocked a degree of 'premium' unlike anything our team had delivered before," said the two Sonos software engineers. "Most important to our designers, the ease with which new UIs can be built means that our team spends less time saying 'no' to specs and more time iterating on them." ®

Similar topics


Other stories you might like

Biting the hand that feeds IT © 1998–2022