Skip to content

(WIP) Deprecate Material and Cupertino#186915

Draft
justinmc wants to merge 3 commits into
flutter:masterfrom
justinmc:deprecate-design
Draft

(WIP) Deprecate Material and Cupertino#186915
justinmc wants to merge 3 commits into
flutter:masterfrom
justinmc:deprecate-design

Conversation

@justinmc

@justinmc justinmc commented May 21, 2026

Copy link
Copy Markdown
Contributor

Material is moving to material_ui and Cupertino is moving to cupertino_ui. Once we're ready for those packages to be used, we should deprecate the old libraries so that users receive a deprecation warning and are encouraged to migrate. This PR should not be merged until then.

#172942

TODOs

  • Deprecate and add a dart fix for Cupertino.
  • Publish material_ui and cupertino_ui at v1.0.0.
  • Land the dart fixes from this PR in material_ui and cupertino_ui.
  • Migrate the whole framework to the new packages.
  • Make sure we're ready for most Flutter users to get nudged to migrate.
  • Land this PR.

This is being done so that users will be encouraged to migrate to
material_ui.
@justinmc justinmc self-assigned this May 21, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 21, 2026
@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: tech-debt Technical debt, code quality, testing, etc. labels May 21, 2026
@MarlonJD

Copy link
Copy Markdown
Contributor

I tested the new dart fix path against the migration cases from #172935 and found one issue in the current fix-data.

The Material library replacement transform currently uses replacedby / newlibrary. With that exact syntax, analyzer reports the deprecated package:flutter/material.dart import, but dart fix --dry-run reports Nothing to fix!.

I opened a small stacked PR against this branch: justinmc#149

That changes the keys to replacedBy / newLibrary. After that, dart fix applies the Material migration for normal imports, show, hide, prefixed imports, and it also adds material_ui: any to pubspec.yaml.

The remaining gap I found is export directives: export 'package:flutter/material.dart' is still diagnosed as deprecated but is not rewritten by dart fix.

Fix Material library replacement fix-data keys
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 3, 2026
@justinmc

justinmc commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

I've merged justinmc#149, thanks!

@Piinks Piinks mentioned this pull request Jul 8, 2026
10 tasks
pull Bot pushed a commit to edisplay/flutter that referenced this pull request Jul 9, 2026
Based on flutter#186915

This adds fix data for the migration to the new design packages,
material_ui and cupertino_ui.

I cannot adds tests for it currently, because there is no analyzer
trigger without the deprecation. The Dart team is working to add the
ability to manually trigger the fix in
https://dart-review.googlesource.com/c/sdk/+/522020

Once these changes land, we can test it out.

Both the Dart change and this one should be cherry picked to the latest
release that was cut yesterday.

Part of flutter#172935

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: tech-debt Technical debt, code quality, testing, etc. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants