The Material and Cupertino design libraries are now available as standalone packages: `package:material_ui` and `package:cupertino_ui`. In Flutter 3.47, developers can opt in to these packages ahead of the formal deprecation of the in-framework design libraries.
- Who is affected
- Applications and packages relying on the previous behaviour or signature. Code that uses MaterialUiCompatibilityBridge, MaterialApp.builder, FloatingActionButtonLocation and related APIs.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Before and after (from the official guide)
| 1 | − | import 'package:flutter/material.dart'; |
| 2 | − | import 'package:flutter_localizations/flutter_localizations.dart'; |
| 3 | ||
| 4 | // ... | |
| 5 | MaterialApp( | |
| 6 | − | localizationsDelegates: const <LocalizationsDelegate<dynamic>>[ |
| 7 | − | GlobalCupertinoLocalizations.delegate, |
| 8 | − | GlobalMaterialLocalizations.delegate, |
| 9 | − | GlobalWidgetsLocalizations.delegate, |
| 10 | − | ], |
| 11 | // ... | |
| 12 | ); |
| 1 | + | import 'package:material_ui/material_ui.dart'; |
| 2 | ||
| 3 | // ... | |
| 4 | MaterialApp( | |
| 5 | + | localizationsDelegates: GlobalMaterialLocalizations.delegates, |
| 6 | // ... | |
| 7 | ); |
Raw before / after
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
// ...
MaterialApp(
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
// ...
);import 'package:material_ui/material_ui.dart'; // ... MaterialApp( localizationsDelegates: GlobalMaterialLocalizations.delegates, // ... );
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
To migrate your project from the in-framework design libraries to the
standalone packages, you can use the automated dart fix tool
or perform the migration manually.
Automated migration with dart fix
The quickest way to migrate is using the migrate_design_widgets fix rule
with dart fix:
$ dart fix --apply --code=migrate_design_widgetsThis command automatically updates your imports from
package:flutter/material.dart and package:flutter/cupertino.dart
to the corresponding standalone package imports.
pubspec.yaml dependencies, manually add them by running
flutter pub add material_ui or flutter pub add cupertino_ui as needed.
and lint warnings addressed, such as import sorting.
Manual migration
To migrate manually, follow these steps:
-
Add the standalone packages to your
pubspec.yamldependencies:$ flutter pub add material_ui $ flutter pub add cupertino_ui -
Update the imports in your Dart files to reference the new packages.
Code before migration:
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart';Code after migration:
import 'package:cupertino_ui/cupertino_ui.dart'; import 'package:material_ui/material_ui.dart';
Compatibility bridge
During the ecosystem transition, your application might depend on
third-party packages that still import the legacy in-framework libraries
(package:flutter/material.dart or package:flutter/cupertino.dart).
To allow your application to migrate to the standalone packages immediately
without waiting for all dependencies to update, material_ui and
cupertino_ui provide compatibility bridge utilities.
Wrap your app using MaterialUiCompatibilityBridge inside
MaterialApp.builder:
import 'package:material_ui/material_ui.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF6750A4),
),
),
builder: (BuildContext context, Widget? child) {
return MaterialUiCompatibilityBridge(child: child!);
},
home: const HomeScreen(),
);
}
}Bridge capabilities and limitations
MaterialUiCompatibilityBridge injects theme and localization data
downward into the widget tree.
This allows unmigrated child widgets and dependencies that read design state
from context
(such as Theme.of(context) or MaterialLocalizations.of(context))
to continue functioning properly.
However, the compatibility bridge cannot resolve type mismatches
when a dependency exposes, accepts, or returns in-framework SDK types
in its public API signatures (such as passing a FloatingActionButtonLocation,
ColorScheme, or TextTheme as a parameter or callback return value).
Because Dart enforces static typing across distinct package imports,
values from package:flutter/material.dart cannot be assigned to parameters
expecting types from package:material_ui.
Dependencies with API-signature coupling must be migrated to the standalone
package before your application can pass modern types to them.
Decoupled localizations
As part of this transition, flutter_localizations is unbundled
for design components.
Localization delegates and translated strings for Material and Cupertino
widgets now reside directly in package:material_ui and
package:cupertino_ui.
Code before migration:
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
// ...
MaterialApp(
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
// ...
);Code after migration:
import 'package:material_ui/material_ui.dart';
// ...
MaterialApp(
localizationsDelegates: GlobalMaterialLocalizations.delegates,
// ...
);Setting localizationsDelegates to GlobalMaterialLocalizations.delegates
automatically includes the Cupertino and Widgets delegates as well,
simplifying localization setup.
Guidance for package authors
If you maintain an open source package or plugin in the Flutter ecosystem,
migrating to package:material_ui or package:cupertino_ui introduces
a breaking change for consumers who haven't updated their dependencies.
While the symbols and class names remain the same,
they are technically referenced from an entirely new library.
Treat this migration as a major version bump for your package.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Official migration guide
- package:material_ui
- package:cupertino_ui
- Issue 191448
- What's new in Flutter 3.47
- Flutter's Material and Cupertino code freeze
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.