May 2024: Flutter 3.22, Firebase Data Connect, Wasm Updates, Dart Macros Preview

What a month this has been for Flutter!

With the release of Flutter 3.22 and Dart 3.4 at Google I/O, there’s a lot to cover.

Beyond all the Flutter and Dart news, Firebase unveiled Data Connect, a new SQL-based database! And in addition to all the official announcements, I have some nice community updates to share.

So read on to get my full recap!

Landing Flutter 3.22 and Dart 3.4 at Google I/O 2024

After all the recent misinformation about Dart & Flutter layoffs, it’s great to see that more big enterprise companies such as GEICO and LG are betting on Flutter. Adoption continues to grow inside Google, too, with the recent rewrite of the Google Classroom app.

If anything, all the latest product updates make it clear that Flutter & Dart are here to stay:

📝 What’s new in Flutter 3.22

The latest Flutter 3.22 release is like a treasure box full of goodies, big and small.

Big ticket items include Wasm support (now stable on Flutter web) and Impeller (available with the --enable-impeller flag on Android), both delivering significant performance gains (with no effort required on your part).

On the Dart side, we now have experimental support for macros, a feature that has immense potential.

But we also got a bunch of quality-of-life improvements, including asset transformers, a new customizable Flutter web app initialization process, conditional bundling of assets based on flavor, and more.

Read the announcement for all the details:

In addition to the blog post, I also recommend this session from Google I/O, covering the latest updates about Gemini, games, Impeller, macros, and Wasm:

And if you want, you can watch all the Flutter sessions from Google I/O at this link.

📝 Announcing Dart 3.4

The latest Dart release delivers two main features:

  • Complete WebAssembly support on Flutter web
  • Dart macros (experimental)

To appreciate how far Flutter web has come, you can run the Wonderous web app on Chrome, now built with the latest Dart to Wasm compiler.

By adding static meta-programming to the Dart language, macros have the potential to replace code generation (via build_runner) with a much faster solution, while raising the abstraction level of the code you write.

Beyond everyday use cases such as JSON Serialization, macros could be used to reduce the boilerplate code for stateful widgets, as outlined in this proposal.

Macros are only available as an experimental feature for now, but Felix Angelov and Remi Rousselet have already taken them for a ride.

For all the details, read the announcement:

📝 What's new in Firebase at I/O 2024

They did it! The Firebase team finally announced a SQL-based database called Data Connect, which looks very promising!

The premise looks pretty compelling: you define your data models and queries using GraphQL, and Data Connect will:

  • Generate a PostgreSQL schema
  • Serve secure API endpoints
  • Generate strongly typed SDKs for your app

Read on for all the details and the other Firebase announcements:

Data Connect is currently in preview, and it can only generate SDKs for iOS, Android, and web (no Dart yet 😢).

Flutter Articles and Videos from the Community

While the latest Flutter release takes the spotlight, I haven’t forgotten about the usual community articles. 🙂

📝 Why I'm betting on Dart

Dart’s versatility is something that is not often discussed, and this article says it best:

It’s a language that has danced in many arenas over its 12-year life. And as a result, it’s picked up a very diverse and unique set of capabilities, one that I think is difficult to compare to in the modern software landscape.

Indeed, there are no other languages that support both JIT and AOT compilation while also being interoperable with ObjectiveC/Swift, Java/Kotlin, and Javascript. Dart achieves this with its FFI feature, allowing it to wrap over packages written in different languages.

Indeed, Dart has a compelling story waiting to be told, and this article makes some very good points:

📝 Create your own lint rules with custom lint

Ever wanted to write your own linter rules, but don’t know how?

If so, this new article has you covered, showing how to use the custom_lint package to create a new rule with a quick fix to replace print statements with log from the developer library:

📝 How to Print Logs in Flutter into the Console

If you need to print or log something to the console, you can use print, debugPrint, log, or the Logger package. But which one should you choose, and why? Read on to learn more and make the most of the available logging options:

📹 Can you run JavaScript in Flutter?

Have you ever looked for a package that implements some complex functionality, but couldn’t find anything good enough on

In this kind of scenario, you may try to write something from scratch or improve existing packages. But what if you don’t have the time or required expertise?

One option is to leverage the flutter_js package to import existing Javascript libraries and use their runtime APIs (via Dart FFI). This latest video by Andrei Luspa shows how it’s all done:

Latest from Code with Andrea

Over the last few weeks, here’s what I’ve been up to:

Oh, and my FlutterCon talk was accepted, too. 🎉

📝 Code Generation with Dart & Flutter: The Ultimate Guide

This article by Anna Leushchenko is a very comprehensive guide covering these topics:

  • Code generation mechanism: how the code generation mechanism with build_runner works.
  • Useful code-generating packages: an overview of useful packages such as json_serializable, freezed, retrofit, injectable, bdd_widget_test, barrel_files, and how they simplify typical Flutter apps development tasks.
  • Efficient codebase maintenance: practical advice on efficiently maintaining projects that extensively use code generation.

Read on for all the details:

Until Next Time

From the latest Wasm improvements to the upcoming Dart macros feature, there's much to look forward to. And I can't wait to see what the next Flutter releases will bring!

As usual, I'll be busy sharing new Flutter tips and articles. 👍

Happy coding!

Want More?

Invest in yourself with my high-quality Flutter courses.

Flutter Foundations Course

Flutter Foundations Course

Learn about State Management, App Architecture, Navigation, Testing, and much more by building a Flutter eCommerce app on iOS, Android, and web.

Flutter & Firebase Masterclass

Flutter & Firebase Masterclass

Learn about Firebase Auth, Cloud Firestore, Cloud Functions, Stripe payments, and much more by building a full-stack eCommerce app with Flutter & Firebase.

The Complete Dart Developer Guide

The Complete Dart Developer Guide

Learn Dart Programming in depth. Includes: basic to advanced topics, exercises, and projects. Fully updated to Dart 2.15.

Flutter Animations Masterclass

Flutter Animations Masterclass

Master Flutter animations and build a completely custom habit tracking application.