跪拜 Guibai
← Back to the summary

Flutter 3.47 Decouples Material Design; iOS 27 Will Crash Unmigrated Apps

Welcome to follow the WeChat official account: FSA Full Stack Action 👋

I. Core Conclusions

When most Flutter versions are released, you might just need to glance at the title, check out two new Widgets, close the page, and continue writing code. But this time is different. The content of this update is extremely hardcore; it's not adding new features, but restructuring the foundation.

I carefully studied the official announcements for Flutter 3.47 and Dart 3.13, and my conclusion is direct: For developers, there are only two things from this release that need to be put on the agenda immediately. The rest—like Impeller landing on desktop, Wasm progress, Dart's new syntax—can wait.

These two things are:

  1. Material and Cupertino moved out of the SDK: They will become independent packages, updated weekly via pub.dev, no longer constrained by the SDK's quarterly release cycle.

  2. iOS 27 mandates UIScene architecture: If your App hasn't completed the migration, it will crash directly on launch when built under Xcode 27.

II. The Big Move to "Decouple" Material and Cupertino

Previously, if you wanted to use the latest Material component (like a minor style tweak to a Chip), you had to upgrade the entire Flutter SDK, even if that update brought a bunch of underlying logic changes you didn't need at all.

Starting from Flutter 3.47, material_ui and cupertino_ui have been moved to pub.dev.

1. Why do this?

Essentially, this turns the design system from "part of the framework" into a "user of the framework."

Dimension Previous SDK Model Current Independent Package Model
Update Frequency Released quarterly with the SDK Updated weekly via pub.dev
Coupling High (UI deeply bound to rendering, scheduler) Low (Decoupled, supports style-neutral Core)
Applicable Scenarios General scenarios Supports custom design systems, lowers maintenance barrier

This is actually a good thing. For teams wanting to iterate UI styles at extreme speed, or projects aiming to build a completely custom design system, this change is practically a godsend.

2. How to migrate?

Migration is actually very simple; the Flutter team has prepared an automated fix tool.

You just need to run one command in the project root directory:

dart fix --apply --code=migrate_design_widgets

It will automatically change your import 'package:flutter/material.dart' to import 'package:material_ui/material_ui.dart'.

Note: If the automated fix doesn't update your pubspec.yaml, remember to manually add the dependency:

flutter pub add material_ui
# If you use Cupertino, remember to add it too
flutter pub add cupertino_ui

3. A very clever "bridging" solution

There's a detail here worth paying close attention to. If you migrate now, your business code runs through, but what about the 30+ third-party plugins you depend on that still use the old import 'package:flutter/material.dart'? You can't wait for the entire ecosystem to migrate before you start, right?

Flutter 3.47 introduces something called MaterialUiCompatibilityBridge, which is the "magic weapon" to solve this problem. You just need to wrap a layer in the builder property of MaterialApp:

import 'package:material_ui/material_ui.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (BuildContext context, Widget? child) {
        // This line ensures those not-yet-migrated third-party plugins still work normally
        return MaterialUiCompatibilityBridge(child: child!);
      },
      home: const HomeScreen(),
    );
  }
}

With this "bridge," you can upgrade your own business code first without worrying about third-party plugins crashing your app.

III. The Hard Requirement of iOS 27

If the Material migration is a "multiple-choice question," then the iOS 27 requirement is a "survival question."

Xcode 27 and iOS 27 will bring a hard rule: All UIKit-based Apps must adopt the UIScene lifecycle.

If your App hasn't adapted this architecture when built, it will crash directly on launch. This is not a Warning; it's a real crash.

1. Why look at this now?

The most troublesome part is that your CI pipeline currently runs on Xcode 26, and everything looks Green. When Xcode 27 is officially released in the fall, your CI environment updates automatically, and your release task might be stuck right before going live.

2. Which situations require manual operation?

Most Apps only need to complete the migration automatically via the Flutter CLI, but two situations are more troublesome:

  1. You have written custom Native code in your AppDelegate.
  2. A Plugin you depend on is still using the old lifecycle management method.

My personal suggestion is: Run the iOS 27 Beta version this week to test it out.

IV. Other Changes Worth Tinkering With

Besides the two major issues above, there are a few other hardcore updates worth your attention.

1. Impeller Lands on Desktop

Previously, desktop platforms (macOS, Windows, Linux) using Skia often encountered the so-called "first-frame jank" (Shader Compilation Jank). This was because Skia dynamically compiles shaders at runtime, struggling during the first frame render, and becoming smooth after caching.

Now, Impeller has become the default renderer for desktop.

Impeller's approach is very brute-force: no more runtime compilation; instead, a fixed set of shaders is pre-compiled during the build phase. This way, even the first frame is silky smooth.

2. Dart 3.13's "Slimming Down" and New Features

The theme of Dart 3.13 is "conciseness."

3. The "Last Mile" for Wasm

The ultimate goal for Flutter Web is Wasm. To solve the problem of slow initial loading for large projects under Wasm, Dart 3.13 introduces Deferred Loading.

Using flutter build web --enable-wasm-deferred-loading, your App doesn't need to pull down all the code at once during startup, which is very helpful for improving IPL (Initial Page Load time).

V. Finally

In summary, the focus of this upgrade is on "decoupling" and "infrastructure."

Suggested action guide for you:

If you are a developer maintaining a Package, be sure to treat the Material migration as a Major Release, because your downstream users are watching your updates.


References:

If the article was helpful to you, please don't hesitate to click and follow my WeChat official account: FSA Full Stack Action, this will be the greatest encouragement for me. The official account covers not only Android tech but also iOS, Python, and other articles; there might be skill points you want to learn about~