Flutter 3.29 and Dart 3.7: Making Our Dev Lives Even Easier!

As a Flutter developer, I'm always excited when a new version is released and let me tell you, Flutter 3.29.0 and Dart 3.7 are packed with new updates that are going to make our day-to-day coding lives significantly better.

And let's be honest, I think a big part of why we're seeing such a focus on developer experience in this release is the recent decision by the Dart team to shelve the macros project. While macros were promising, it's clear that the resources freed up by that decision have allowed the team to focus on delivering concrete improvements right now that will benefit all of us.

So, while I was initially curious about macros, I'm much happier to see the team's energy directed where it can have the biggest immediate impact. I've been digging into the release notes, and the improvements are great. Let's break down some of the highlights that have me the most excited.

Wildcard Variables: Less Typing, More Clarity!

Okay, Dart 3.7 introduced something small but mighty: wildcard variables.  If you've ever found yourself writing an anonymous function where you don't actually use the parameter, you know the drill. We used to do something like this:

myList.forEach((_) {
  // Do something that doesn't use the element
  print('Processing...');
});

And if there were multiple of these variables it ended up being:

list.where((_,__, ___) => true);

This change may remove the need for the 'no wildcard variable uses' lint, which would be great! Now, with Dart 3.7, the underscore (_) becomes a true wildcard. We can use it multiple times in the same scope without name collisions!

someFunction((_, _, _) { ... }); // Totally valid!

This is a small change, sure, but it's one of those improvements that reduces mental overhead. We no longer need to remember to ignore those unused parameter warnings, or come up with increasingly silly variable names (I've definitely used __ and ___ more times than I care to admit!). It's cleaner, it's more readable, and it's just nicer.

The New Flutter Inspector: Layout Debugging Bliss!

Debugging layouts used to be... an adventure. But the redesigned Flutter inspector in DevTools (now the default!) is really beneficial.The new Widget Tree is so much more intuitive. The visual representation of parent-child relationships is clearer. The ability to see widgets is a huge help. The Widget Explorer is also fantastic. Now you can see all of the parameters of the widget and its renderObject. With flex widgets you also get the added extra of being able to change the alignment and see the result,

"Tall Style" Formatting: Finally, a Consistent Look!

This one is HUGE. We've all been there, manually adding and removing trailing commas to get dart format to give us that beautiful, vertically-aligned "tall style" for argument and parameter lists. It was tedious, and it led to inconsistent formatting across projects (and even within the same project!).

Flutter 3.29 automates this. Trailing commas are now treated like whitespace by the formatter. If a list splits, it always uses the tall style:

someLongFunction(
  veryLongArgument,
  anotherLongArgument,
);

This is the style the vast majority of Flutter developers (myself included!) prefer, and now we get it automatically! No more fighting with the formatter, no more code review comments about missing or extra commas. It's a massive win for consistency, developer sanity and I think it will save us time. 

page_width in analysis_options.yaml: Project-Wide Formatting Bliss!

Another long-requested feature has arrived! We can now configure the page_width (formerly --line-length) for dart format on a project-wide basis using the analysis_options.yaml file.

formatter:
  page_width: 120

This is a massive step towards consistent code style across entire projects and organisations. No more per-file overrides (though you can still do that with a comment if you absolutely need to, for things like tables of data).  It makes collaborating on large projects much smoother.

Cupertino and Material Goodness

It wouldn't be a Flutter release without some polish on our favourite UI components!  Flutter 3.29 brings some great improvements:

  • Cupertino:
    • CupertinoNavigationBar and CupertinoSliverNavigationBar now support a bottom widget, perfect for search fields or segmented controls, mimicking the latest iOS designs.
    • The CupertinoSheetRoute is now in stable, offering the drag-to-dismiss behaviour that's so common on iOS.
    • CupertinoAlertDialog gets a visual refresh in dark mode to better align with native iOS.
    • Text selection handles have also been improved.
  • Material:
    • CircularProgressIndicator and LinearProgressIndicator have been updated to match the latest Material 3 spec. You can opt into the new style with the year2023 flag.
    • Slider also gets the Material 3 treatment!
    • More flexibility in customising IconButton, Chip, Tooltip, DropdownMenu, SnackBar, TabBar and NavigationBar.

6. Dart Analyser Improvements - Keeping Our Code Clean

The Dart analyser keeps getting smarter, and 3.7 is no exception. We've got new fixes and assists that make our code cleaner and more efficient:

  • Automatic conversion of ~/ operations to / when it's not supported.
  • Help with importing missing identifiers, including handling prefixes.
  • More suggested fixes for cascade_invocations and other common lint rule violations.
  • New lint rules, including strict_top_level_inference, unnecessary_underscores, and experimental rules for safer type inference.

These improvements might seem small, but they add up to a smoother, more enjoyable development experience. The analyzer helps us write better code, and that's always a win!

Flutter Web: WASM and More Streamlined Image Handling

Flutter on the web continues to evolve. This release loosens some restrictions on HTTP response headers, which simplifies working with WebAssembly (Wasm). It is still recommended to enable full wasm support. We also got some nice improvements to image handling in Flutter web, dealing with cross-origin restrictions more gracefully.

Platform Views & Merged Threads

The Engine Team is working on a large project to bring all three threads -Platform, UI and Raster threads, all onto one thread. This change should make platform channels, plugins and general platform integrations easier.

A Necessary Trade-off: Focusing on What Matters

This brings me to a point that's crucial to understand about this release. The Dart team recently announced they're shelving the ambitious "macros" feature. While it's natural to feel a pang of disappointment (I was looking forward to playing with macros, too!), I see this as a very positive move.

The Dart team stated explicitly that the performance and complexity of macros, as they envisioned them, were proving too challenging. Rather than deliver a subpar feature that might have hampered the developer experience, they're focusing their energy on other, more impactful improvements. And, importantly, they've confirmed they still intend to find better ways to handle data serialisation, which was a primary motivator for macros. I believe it's a major reason we are getting all these other optimisations. Which in my opinion, is a benefit! 

Flutter 3.29.0 and Dart 3.7 are all about refining the developer experience. From small improvements like wildcard variables to major style overhauls and performance boosts, this release shows the Flutter team's commitment to making our lives easier. I'm particularly excited about the automatic formatting changes,  it's going to save me so much time and mental energy! I encourage everyone to upgrade and start exploring the new features. Here at Foresight Mobile, we continue to build some amazing apps with Flutter. If you would like to read more about Flutter or the latest tech updates, head to our blog.

Discover Nikola Milosevic, our senior developer from Novi Sad, Serbia, who excels in Flutter and app development while enjoying basketball.

We'd love to show you how we can help

Get in Touch  

Latest Articles

All Articles