Flutter 3.0 is here! Here’s all you need to know.

Swapnil Shah
Simform Engineering
8 min readMay 18, 2022

It has just been three months since the last stable release of Flutter, and it is time for one more substantial update to Flutter.
🥁 Bonjour, Flutter 3.0.

Ever since the last update that enabled full Windows support for Flutter, there have been a lot of new changes and some reduction of support for older Windows. Let’s dive in!

Stable-quality support for macOS and Linux apps

Until now, Flutter only supported building stable Windows apps. With Flutter 3.0, you can now build stable, beautiful, and custom user experiences on macOS as well as Linux!

You can build an app that fully embodies the macOS system look and feel with the macOS UI package. You can also sign your executables, meaning users do not get warnings about “Untrusted Publishers.”

MacOS UI Widget Gallery.

That takes the list of platforms supported by Flutter to SIX:
Android, iOS, Web, Windows, macOS and Linux.

Complete support for Apple Silicon

While Flutter has already worked on Apple Silicon since day one, Flutter 3.0 completes the support on Apple Silicon.

Two developer journeys matter to Apple silicon: how to use those machines as your development environment and how to compile binaries in the ARM 64-bit architecture. Hence, they run natively on Apple silicon.

You’ll no longer need to rely primarily on Rosetta translation when analyzing or compiling code for the Flutter app.

That also means there are now two versions of the Flutter SDK for macOS — ARM and Intel.

Now deploy iOS applications with just one command!

Are you fed up swinging back and forth between Xcode and your IDE? Flutter got us this time!
Suppose you have previously tried to export builds. In that case, you know the hassle of first archiving the app in the archive bundle. Then after exporting the archive into an IPA bundle for distribution of the app to store/device/enterprise distribution, you would have to pass in a — export-options-plistfile, which you need to create yourself.

Flutter’s iOS distribution docs don’t say what needs to go into the plist. Instead, it just points to Apple docs, or tells them to launch Xcode and create the IPA there.

Now, all you have to do is run the following command:
flutter build ipa

Voila! Your IPA is built in just one step.

Flutter 3.0 now supports building stable Linux applications:

Flutter has collaborated with Canonical, the organization behind one of the most popular distributions of Linux — Ubuntu, which has a suite of packages that add tailored UI and integration with system services. And that includes things like dbus, gsettings, network manager, Bluetooth, desktop notifications, as well as a comprehensive theme and widget set for yaru, which is the Ubuntu look and feel.

Use the Ubuntu Yaru Style — Distinct look and feel of the Ubuntu Desktop.

Flutter 3.0 on the web:

On the web, a new API has been added that provides you control over the loading of the Flutter framework, engine, and your content. And essentially, this lets you run Flutter in headless mode on the web.

So, you can use this API to preload your Flutter app while you are showing a login screen or a progress bar.

Also, Flutter has taken advantage of the latest standards for image decoding.

Below is a stress test of GIF animation where we have hundreds of GIF images all being loaded and decoded in real-time, the left one being the older version.

Mobile Updates

Flutter 3 now supports foldable mobile devices! In collaboration with Microsoft, all-new features and widgets allow you to create beautiful and responsive applications on foldable devices.

MediaQuery contains a list of DisplayFeatures which show the limits and states of foldable device dimensions like hinges, folds and cutouts. Also, DisplayFeatureSubScreen now positions its child without overlapping the limits of DisplayFeatures. It is already integrated with Flutter’s default dialogues and pop-ups, making it ready to deploy on these features.

For more info and screenshots, head over to The Surface Duo Emulator Samples.

Variable refresh-rate support for iOS devices

We have good news for people with high refresh rate iPhones with the ProMotion displays. You can finally build user experiences with a refresh rate up to 120 Hz, instead of the previous limit of 60 Hz, including the iPhone 13 Pro and iPad Pro.

Faster animations like scrolling now feel smoother than ever with Flutter’s support of 120Hz. See flutter.dev/go/variable-refresh-rate for more details.

Flutter Games Toolkit

Flutter is taking advantage of the hardware-accelerated graphics support provided by Flutter and open source game engines like Flame, making it easier for casual game developers to get started.

To get started, go to https://flutter.dev/games

Disallow copy and cut when obscureText is set on TextField

In the previous version of Dart, users could cut and copy the content in the TextField even when obscureText was set.
Now, in Dart 2.17, when obscureText is set, no operations on the contents would be allowed, which means if a field is both obscured and read-only, then the selection is disabled as well.

If you can’t modify it and can’t copy it, there’s no point in selecting it

Ending support for 32-bit iOS/iOS9/iOS10

As announced in February 2022, Flutter’s support will end for 32-bit iOS devices and iOS 9/10. This change affects the iPhone 4S, iPhone 5, iPhone 5C, and the 2nd, 3rd, and 4th generation iPad devices.

Flutter 3 is the last stable release that supports these iOS versions and devices.

That was all from the side of Flutter. Along with these updates, there are a bunch of Tooling updates as well.

Tooling updates!

With Flutter 3.0 also comes the stable update to Dart 2.17.0.

Updated lint package

Version 2.0 of the Lint packages has been released:

The apps you generate in Flutter 3 with flutter create automatically enable the V2.0 lint set.

Existing apps, packages and plugins are recommended to be migrated to V2.0 to follow the latest and greatest in the world of Flutter, by running
flutter pub upgrade --major-versions flutter_lints

Inline ads on Android

Previously, when using the AdMob package, we faced a multitude of performance issues. Now, use the google_mobile_ads package.
You will instantly see a performance improvement in user interactions, such as scrolling and transitions between pages. This is particularly noticeable in the newer devices being released.

Dart Updates

Along with Flutter 3, we also get a Dart update to 2.17.0, which includes more than 5600 Pull Requests Merges. Here are some key changes to Dart:

FINALLY, THE UPDATE WE WANTED FOR NAMED ARGUMENTS

We had to add named arguments at the end of the last position of the constructor. From Dart 2.17, place them anywhere you want in the constructor.

class Animal {
Animal(this.name);
final String name;
}
class Cat extends Animal {
Cat(super.name, {required this.age});
final int age;
void meow() => print('$name is $age year-old and meows');
}
void main() {
Cat(age: 4, 'Kitty').meow();
}

Massive update to enums

Yes, you read that right. We can now super-charge enums with the new update; we can even define methods. Look at the amount of functionality you can add in the below example:

enum Phones {
samsung('S22 Ultra', 180);
oneplus('9Pro', 120);
apple('iPhone 12 Pro', 220);

final String phoneName;
final int phonePrice;
const Phones(this.phoneName, this.phonePrice); String get namePrice => '$phoneName:$phonePrice'; String hello(String name) {
return 'My name is $name and I have a $phoneName that costs $phonePrice!';
}
@override
String toString() {
return 'The phone name is $phoneName and phone price is $phonePrice';
}
}
void main() {
print(Phones.samsung.hello('Swapnil'));
print(Phones.oneplus);
print(Phones.apple.name);
}

Super Constructors

Say goodbye to boilerplate code for passing constructor arguments to the superclass! Instead of defining super(argument) just use super.argument
It has become that simple now.

class Language {
Language(this.name);
final String name;
}
//OLD WAY
class Flutter extends Language {
Flutter(super.name, this.age) : super(name);
final int age;
}

The new syntax is straightforward

class Language {
Language(this.name);
final String name;
}
// NEW WAY: DART 2.17 AND ABOVE
class Flutter extends Language {
Flutter(super.name, this.age);
final int age;

There are a lot of other changes, you can refer to https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0

Breaking changes

With the release of Flutter 3, we have the following breaking changes:

If you are using any of these APIs, please refer to the migration guide on Flutter.dev.

Deprecating Windows 7/8 for development

With this release, the recommended Windows version for development is raised to Windows 10. While Google is not blocking development on older versions (Windows 7, Windows 8, Windows 8.1), Microsoft’s versions are no longer supported and provide limited testing on these releases. While Google will continue to offer ‘best effort’ support for older versions, they encourage you to upgrade.

Note: Google continues to offer support for Flutter apps running on Windows 7 and Windows 8; this change only affects the recommended development environment.

Summary

Well, this was Flutter 3.0 in a nutshell. I have tried to summarise every noteworthy update that would be helpful to most of you. If you want to look at the entire list of changes, you can refer to https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0

For a detailed video regarding Flutter 3.0, watch this video:

References

Hope this article has helped you learn something new today. If you’ve enjoyed reading this article, be sure to throw me a couple of claps!👏

--

--