Upgrades and deprecations
Flutter material_ui and cupertino_ui Standalone Packages Migration: Imports, Bridge and Localizations
In short
The Flutter material_ui and cupertino_ui standalone packages migration swaps package:flutter/material.dart and cupertino.dart for two pub.dev packages. Flutter 3.50 formally deprecated the bundled libraries. Run dart fix --apply --code=migrate_design_widgets, add the packages if the fix does not, update localization delegates, and use the compatibility bridge while dependencies catch up.
What moved, and on which Flutter releases
Material and Cupertino used to ship inside the Flutter SDK, so every widget fix waited for an SDK release. The Flutter migration guide gives three reasons for the split: fixes that waited for quarterly releases, slower contributions, and apps that could not update the design libraries on their own. The packages now live in the flutter/packages repository, and the guide says weekly releases are planned.
The Flutter blog post of 7 April 2026 announced the freeze: contributions to Material and Cupertino in flutter/flutter stopped, and the frozen copy is what you get on Flutter 3.44 or later. That post asked most developers to wait for migration instructions, and those arrived with 3.50.
| Flutter release | What happened to Material and Cupertino |
|---|---|
| 3.44 | Contributions to the in-SDK libraries frozen |
| 3.47 (12 August 2026) | Version 1.0 of `material_ui` and `cupertino_ui` published on pub.dev; apps can opt in |
| 3.50 (11 November 2026) | In-framework libraries formally deprecated; migration guide published |
| Removal | No version or date stated in the guide; the packages follow semantic versioning |
How to migrate to material_ui and cupertino_ui with dart fix
The guide's automated route is one command, run from the app's root, followed by a second plain dart fix pass for the follow-on fixes and lint warnings such as import sorting. The full sequence is the short block at the end of this section; what it changes is listed first.
- Before:
import 'package:flutter/material.dart';andimport 'package:flutter/cupertino.dart';. - After:
import 'package:material_ui/material_ui.dart';andimport 'package:cupertino_ui/cupertino_ui.dart';. - The guide notes that
dart fixmay leave pubspec.yaml alone, which is why the twoflutter pub addlines exist. A missing dependency shows up as an unresolved import; the Target of URI doesn't exist page covers that message. - On 29 November 2026 pub.dev listed
material_ui1.11.1 andcupertino_ui1.1.7, both from the verified flutter.dev publisher. Expect those numbers to move often if the weekly plan holds.
dart fix --apply --code=migrate_design_widgets
flutter pub add material_ui # only if dart fix did not add it
flutter pub add cupertino_ui # only if you use Cupertino widgets
dart fix --applyThe ambiguous import trap with flutter_localizations
This is the step most likely to break a build after the fix runs. The guide explains that dart fix adds the new imports but leaves package:flutter_localizations/flutter_localizations.dart in place. That library still exports its own deprecated GlobalMaterialLocalizations and GlobalCupertinoLocalizations, so any file that imports both gets an ambiguous_import error where those names appear.
Two ways out, both from the guide. If a file still needs GlobalWidgetsLocalizations, narrow the old import with show GlobalWidgetsLocalizations. Otherwise drop it and set localizationsDelegates: GlobalMaterialLocalizations.delegates from material_ui, which the guide says brings in the Cupertino and Widgets delegates as well. A Cupertino only app can use GlobalCupertinoLocalizations.delegates from cupertino_ui; a CupertinoApp that also shows Material widgets needs the Material list or it fails with No MaterialLocalizations found.
Apps that use flutter gen-l10n hit one more gap. In 3.50 the generator still writes code against the deprecated delegates. Until the fix tracked in Flutter issue 191072 reaches stable, the guide's workaround is to build the delegate list by hand, with your AppLocalizations.delegate first and the spread GlobalMaterialLocalizations.delegates after it, and to add header: '// ignore_for_file: deprecated_member_use' to l10n.yaml, removed again once the fixed release lands.
Checked against: source 1
What MaterialUiCompatibilityBridge does in the standalone packages migration
Your own code can switch in an afternoon, but third party packages may still import package:flutter/material.dart. For that window, material_ui ships MaterialUiCompatibilityBridge and cupertino_ui ships CupertinoUiCompatibilityBridge. You return the bridge from MaterialApp.builder (or CupertinoApp.builder), wrapping the child, or wrap only the subtree that holds the old widgets.
The bridge pushes theme and localization data down the tree, so unmigrated widgets that call Theme.of(context) or MaterialLocalizations.of(context) keep working. It is deprecated by design, so it raises deprecated_member_use; the guide silences that with an ignore comment and says to remove the bridge once your dependencies move.
Its limit is types. When a dependency takes or returns SDK design types in its public API, such as a ColorScheme, a TextTheme or a FloatingActionButtonLocation, the bridge cannot fix the mismatch, and that dependency has to migrate before you can pass it the new types. Before starting, I would list every package in pubspec.yaml that exposes theme or color parameters, since those are the ones that can block you.
Material and Cupertino as standalone packages: advice for package authors
If you publish a Flutter package, the guide says to treat the switch as a major version bump. Class names stay the same, but they now come from a different library, so a consumer who has not migrated would break. The semantic version calculator can confirm which number your next release should carry.
A sensible order from the guide's wording: release the migrated package as a new major, tell users which Flutter release they need, and keep the old major alive for apps still on the bundled libraries.
Checked against: source 1
A checklist for the standalone packages migration, and the separate Gradle change
Built from the guide, in the order I would run it on an app:
- Upgrade to Flutter 3.50, run the dart fix command, then run
dart fix --applyagain. - Confirm
material_uiand, if used,cupertino_uiare in pubspec.yaml. - Search for
flutter_localizationsimports and fix anyambiguous_importerrors. - Switch to the new delegate lists; apply the gen-l10n workaround if you generate localizations.
- Add the compatibility bridge only if a dependency still imports the old libraries, and note which one so you can remove it later.
- Build each platform and run your widget tests.
- Do not confuse this with the Android build change in the same period. The built-in Kotlin guide says Android Gradle Plugin 9 makes built-in Kotlin the default, that Flutter 3.44 kept the legacy Kotlin Gradle Plugin working with
android.builtInKotlin=false, and that 3.47 allowsandroid.builtInKotlin=trueonce every plugin has migrated. It has nothing to do with widgets; the common build failure is under Kotlin source sets not allowed with built-in Kotlin. - The iOS side has its own move this year, from CocoaPods to SwiftPM, in the Flutter Swift Package Manager migration. Android release deadlines are in the Play target API level 36 dates, and the full list is on the upgrades hub. The facts here were read on 29 November 2026; recheck the guide for a removal date and for the gen-l10n fix in later releases.
What else do people ask?
Is package:flutter/material.dart removed in Flutter 3.50?
No. It is formally deprecated in 3.50. The migration guide gives no removal version or date.
What is the dart fix code for the material_ui migration?
dart fix --apply --code=migrate_design_widgets. It rewrites the imports; add the packages with flutter pub add if it does not.
Why do I get ambiguous_import after migrating to material_ui?
flutter_localizations still exports deprecated GlobalMaterialLocalizations and GlobalCupertinoLocalizations. Narrow that import with show GlobalWidgetsLocalizations or remove it.
Can I migrate before my dependencies move to the standalone packages?
Yes, with MaterialUiCompatibilityBridge or CupertinoUiCompatibilityBridge in your app's builder. It does not help when a dependency passes SDK design types such as ColorScheme through its public API.
Should a package author release the cupertino_ui switch as a minor version?
The guide says to treat it as a major version bump, because consumers who have not migrated would break.
Sources
- Flutter documentation, Migrate to standalone material_ui and cupertino_ui packages, fetched 2026-11-29
- Flutter documentation, What's new in the docs (3.47 and 3.50 entries), fetched 2026-11-29
- pub.dev, material_ui package page, fetched 2026-11-29
- pub.dev, cupertino_ui package page, fetched 2026-11-29
- Flutter blog, Flutter's Material and Cupertino code freeze (7 April 2026), fetched 2026-11-29
- Flutter documentation, Migrating Flutter Android projects to built-in Kotlin, fetched 2026-11-29
Keep reading
Read next
- Flutter cannot find the generated gen_l10n localizations fileFix: Target of URI doesn't exist: 'package:flutter_gen/gen_l10n/gallery_localizations.dart'
- App Broke After a Flutter Upgrade: What To DoFor owners: Flutter publishes breaking changes with every release, and an upgrade can break code that worked before.
- VS Code underlines package:flutter/material.dart as a missing targetFix: Undefined class 'StatelessWidget'.