Did You Miss It? The New Version Arrived: Flutter 2 (2021)
📅 2021.03.03 - 👤 Borbély Viktor
source: YouTube – Flutter Engage event 2021
Spring is here, nature is renewing, and this is no different at Google. The Flutter Engage show announced months ago brought a huge announcement. Flutter 2 has arrived, as they mention the Flutter UI kit ecosystem. Let’s look at the more important announcements.
The keynote was presented by Tim Sneath (Director, Flutter & Dart, Google), from which I highlighted a few more interesting parts. My writing wanders between technology and business development.
Web went live
Simultaneously with today’s announcement, the SDK Release versions are also available on their website, where the Flutter 2 version number appears. A jump in the main version always suggests a big step forward. It’s no different with Flutter 2.
The framework moved from Beta status to Stable channel on 4 platforms: Windows, Linux, macOS, Web. With this it achieved supporting 6 platforms with one codebase (95% without modification).
Among these, Web is the most exciting for me, being a mobile app developer. I’ve only touched web before when necessary. But after this, it means I can write beautiful, fast, and efficient code. Although I already used the Web Beta version before. With surprisingly good experience in production products, but getting the stable seal is definitely an important step.
Of course, it’s not for everywhere, but where it’s an application-centric solution, it’s a good choice. Such as in PWA ( Progressive Web App), SPA (single page app) cases.
Interestingly, on Ubuntu Linux, applications can be easily released and installed on the Snapcraft market.
Ads in the application
Ads have always been present in applications. The “Google Mobile Ads SDK for Flutter” plugin offers a solution for this. It builds seamlessly into the UI theme. Ad banners can be placed anywhere. In the report, the music publisher company reported a 350% impression and 43% CTR increase. Although it seems extreme, it’s worth trying it.
(Null)Safety First!
”Safety first!” we could say. In modern languages, it’s an expectation to protect stable business logic from errors. It’s known that the later we notice a bug, the higher the fix costs soar.
Bob Nystrom presented the nullsafety introduced in the Dart language, that is, null checking. With this language construct, already when writing code, the compiler checks whether there will be a fatal error during runtime. So it’s not runtime, but already at compile time we’ll know if our code is correct.
Of course, this is a small part of code correctness, but it’s no accident that many languages place emphasis on this. This is such a typical error that’s hard to find, but with good design, we can place so-called checkpoints in our code. By this, we also better express our intention so that our colleague also learns about it. After all, the product lifecycle needs to be synchronized in space and time with a large team.
Additionally, it became clear from his speech that many null checks give 2-3x more work to the CPU, which has cost implications. With this language solution, we can trim this.
Dual screen mode
Looking at Flutter’s strategy, it wants to conquer every existing screen. Working together with Microsoft, the Surface Duo runs on the Android operating system. Support for this was completed in the Flutter 2 release so that content can be served in various ways for foldable screens. Several UI patterns were developed for this that serve our daily tasks in the necessary way.
source: www.microsoft.com Surface Duo
Good news for those who want to try it, that the Surface Duo is available in emulator form.
Efficiency in the developer’s hands
During development, it greatly speeds up work that we can check appearance modifications on the screen in a fraction of a second (Stateful hot reload). This is not new to a web developer, but it’s also available in Flutter. This can speed up daily 8-hour work by even 10-15%. Not to mention the reduction of frustration due to waiting.
Kenzie Schmoll presented four areas that brought development environment updates. I note that the Flutter team has placed great emphasis on the availability of appropriate tools from the beginning.
- flutter fix: automatic code maintainer
- null-safety migration: automatic nullsafety checking and fixing for safety
- Flutter Inspector: for uncovering and fixing UI errors
- app size checking so user experience is optimal
The event videos can be rewatched on the YouTube channel.
In the past 2 years since Flutter came into my sight, it has provided numerous innovations month after month. This is the mobile and web platform of the future, perhaps it’s not excessive to state this.
For my previous writings, look around in my blog posts.