December 2024: Flutter 3.27 Release, Architecture Case Study, Dart Microbenchmarks, and Union Types

Welcome to my final Flutter newsletter of 2024!

This edition is packed with exciting updates:

  • The mighty and much-awaited Flutter 3.27 release
  • Flutter's Production Era (livestream recap)
  • A new official architecture case study
  • Deep-dive articles about benchmarks and union types
  • Latest updates from Code with Andrea

So grab a drink, relax, and enjoy the read! 🍷

Flutter 3.27 Release

Flutter 3.27 is a big release that brings many updates across the framework, engine, and ecosystem. Highlights include:

Read the full announcement:

📝 Announcing Dart 3.6

Released alongside Flutter 3.27, Dart 3.6 introduces pub workspaces. This allows the Flutter analyzer to process all of the packages in a pub workspace in a single analysis context. For large repositories, this can significantly reduce the memory used by the Dart language server, improving IDE performance.

Another nice addition is the support for digit separators, for better readability of large numbers. Learn more here:

📝 Announcing Flutter AI Toolkit

The Flutter team also announced the Flutter AI Toolkit, a collection of ready-to-use AI chat widgets designed to seamlessly integrate into your Flutter projects (a sample Flutter AI chat app is also available).

The toolkit provides features like rich text display, voice input, multimedia attachments, and more, making it easier to add an AI chat experience to your app. The toolkit also offers pluggable LLMs, meaning you can use it with different AI models.

Here's the full announcement:

Note: the flutter_ai_toolkit package uses Firebase under the hood. If you don't want to use Firebase, it may not be the best fit for your project.

Flutter in Production Event

Last week’s #FlutterInProduction livestream celebrated Flutter’s 10-year journey. Some stats stood out:

  • 1M+ monthly active Flutter developers 📈
  • 28% of new iOS apps on the App Store use Flutter 🤯

The livestream also offered a peek into some experiments and planned features, including:

After the livestream, Matt Carroll expressed strong opinions and concerns about decorators. As a follow up, Remi Rousselet made an interesting proposal that uses a pipe operator to reduce nesting. For now, keep in mind that decorators are only an experiment—time will tell if something will come out of this.

If you missed the livestream, you can watch it on YouTube:

A written recap is also available:

✨ Flutter is Now a Monorepo!

Here’s a big change that flew under the radar: the Flutter engine has been merged into the main Flutter repository! 🎉

This brings some clear benefits:

  • Framework and engine code are now built, tested, and shipped together
  • Improved efficiency and collaboration for the Flutter team and external contributors

Architecture Case Study

Last month, I've mentioned that the Flutter docs have a new guide about app architecture.

Since then, this architecture case study has been added, showing how the official compass sample app was built.

The guide covers:

For all the details, check the full case study:

In my opinion, the guide does a good job at explaining important architectural concepts and offers a good overview of how the UI layer and data layer interact with each other. While implementation details such as using ChangeNotifier and the provider package may work well for the compass sample app, they may fall a bit short for more complex apps. Bottom line: use the principles as guidance and find the most suitable implementation based on your preferences and project requirements.

Flutter Articles

This month, I'm sharing two very good articles about Dart microbenchmarks and Union Types.

📝 Microbenchmarks are experiments

Lately, someone posted this pretty visualization comparing the performance of various programming languages on a meaningless benchmark.

While such posts are good for engagement farming, the devil is in the details. So I was extremely pleased when Slava Egorov (tech lead of the Dart Language) posted this take:

Sigh. 2025 is almost around the corner and people still seem to think that the goal of a benchmark is to produce a number which by itself reveals some hidden truth about the world. You write a loop in Dart, you write a loop in C. You run it three times (statistics!). You compare the running time and, lo and behold, these two numbers reveal you all you need to know about Dart and C performance. The rest of the day can be spent browsing numerological magazines for the meaning of your date of birth…

He then proceeded with a detailed breakdown of the benchmark, including a low-level performance comparison between JavaScript and Dart (yay, assembly code!).

The full post is very much worth a read:

Ironically, OpenAI recently announced their latest o3 model, showing that o3 achieved a 87.5% score on the ARC-AGI benchmark and implying that it is close to AGI. As it turns out, the model itself was specifically trained on the benchmark 🤦‍♂️. Bottom line: things aren't always as they seem, and some good old critical thinking is required to discern between hype and reality.

📝 Demystifying Union Types in Dart, Tagged vs. Untagged, Once and For All

Union types are a concept that appears in many languages, but they are often misunderstood.

This article by Majid Hajian is a deep-dive into Union Types (untagged and tagged unions)—what they are, why they’re helpful, where they fall short, and why, in strongly typed languages like Dart, you might want to reconsider their use.

Read on to get a better conceptual understanding of union types, so you can choose the right language features or constructs (e.g. sealed classes) depending on your use case:

Latest from Code with Andrea

Since the last newsletter, I've been quite busy:

If you missed them, here's a summary of the latest articles:

📝 How to Release Your Flutter App on the iOS App Store

The Flutter documentation already provides a good technical guide for building and releasing an iOS app. But publishing your first app involves more than just building and uploading. There are many steps to follow, and they aren’t always obvious.

This article will provide a high-level roadmap for releasing your Flutter app on the App Store. Even if you’re familiar with this process, you may discover a trick or two along the way.

📝 How to Build a Robust Flutter App Initialization Flow with Riverpod

Earlier this year, I shared an article about stateful app initialization with Riverpod.

Since then, I discovered a flaw that was breaking URL-based navigation in my original setup. So, after finding the solution, I've rewritten the article entirely. 👇

I've also updated my Starter Architecture repo to use the new technique:

Until Next Time

2024 is nearly over and this year, I've shared 12 new articles and 81 new tips about Flutter app development.

Over the next week, I'll take some time to reflect on my journey as a Flutter educator and share my 2024 retro (if you're curious, here’s the 2023 edition).

But for now, I want to thank you for reading and supporting my work this year, and I wish you a happy festive season! 🎉

Happy coding!

Andrea

Want More?

Invest in yourself with my high-quality Flutter courses.

Flutter In Production

Flutter In Production

Learn about flavors, environments, error monitoring, analytics, release management, CI/CD, and finally ship your Flutter apps to the stores. 🚀

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. Last updated to Dart 2.15.

Flutter Animations Masterclass

Flutter Animations Masterclass

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