Google I/O is happening right now, and that means, of course, there’s a bunch of new Android development news! If you’re reading this post, then that means Google has just (or already) announced Flutter 2.2, a new version of their cross-platform app development framework.
Flutter Adoption Stats
There’s actually quite a bit of new stuff for a point release, but before we get into that, we should talk stats. Google is pretty proud of Flutter, and it seems like that’s for good reason. According to data cited from SlashData, Flutter is now the most popular cross-platform development framework, with 45% of cross-platform developers choosing to use it.
That popularity is the result of some pretty big growth. Over the course of a year, from early 2020 to early 2021, Flutter has seen a 47% growth in usage, and over 12% of all the apps available in the Play Store are programmed in Flutter. 12% may not seem like a lot, but the Play Store has a lot of apps; over 200,000 of them are using Flutter.
Language Features of Flutter 2.2
With that out of the way, let’s talk about the technical side.
Back with the release of Flutter 2.0, Google introduced sound null safety. Null safety allows developers to indicate whether a variable or value can be null directly from the code. Kotlin has the same feature, and I can tell you from personal experience that it makes null-pointer-related errors much less common. In Flutter 2.2, null safety is now enabled by default in new projects.
On top of null safety, there are also some performance improvements in Flutter 2.2. When building for the web, you can now cache resources in the background using service workers. On Android, you can use deferred components, letting you download Flutter components at runtime as needed and reducing app size. And for iOS, you can precompile shaders to make animations smoother when they’re run for the first time. Finally, there are new tools in the DevTools suite that let you analyze memory usage in your app and find problem areas.
Flutter 2.2 also brings some new features and SDKs. First, there’s been more work on making web applications more accessible. While there was a push for accessibility back in version 2.0, it wasn’t quite complete. In terms of SDKs, the Flutter Ads SDK has been updated with built-in null safety and adaptive ad banners. Finally, there’s a new payment plugin that lets developers process payments for physical items on iOS and Android.
Along with all of the aforementioned changes, the underlying language, Dart, has been updated to version 2.13. Dart’s Foreign Function Interface reached stable in 2.12, and in 2.13, includes support for arrays and packed structs. Dart 2.13 also adds type alias support. And for the automation fans out there, Dart now has official GitHub Actions support and an official Docker image for automated building and execution.
With changes in Flutter and Dart done, you might think that’s the end of this article. But it’s not. Not quite. There are two more things Google has highlighted in this release.
The second is Flutter for UWP. UWP stands for Universal Windows Platform and is what (some) modern-style apps in Windows 10 are built with. UWP support brings the ability to develop more native-looking applications for Windows. Similar to Flutter for Tizen, this is an alpha, so it isn’t quite ready for primetime.
For a point-release, there’s quite a bit that’s changed with Flutter 2.2 and Dart 2.13. There are new language features, new SDKs, and even new platforms. Flutter is already exploding in popularity, and these changes aren’t going to slow that down. Remember to check out Google’s posts on Flutter 2.2 and Dart 2.13 for more details and instructions on getting started.