Skip to content

(WIP) Deprecate Material and Cupertino - #186915

Closed
justinmc wants to merge 4 commits into
flutter:masterfrom
justinmc:deprecate-design
Closed

justinmc wants to merge 4 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. p: material_ui material_ui package in flutter/packages 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 done
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
@Piinks

Piinks commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Flyby for when this is returned to: we have to deprecate what we decoupled in flutter_localizations as well

@justinmc justinmc added the CICD Run CI/CD label Sep 21, 2026
@justinmc
justinmc marked this pull request as ready for review September 21, 2026 17:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request deprecates the material library in favor of the material_ui package and updates the corresponding test expectations. Feedback was provided to update the deprecation version format from v3.47 to v3.47.0 to comply with Flutter's deprecation policy and avoid automated test failures.

Comment on lines +17 to +20
@Deprecated(
'Use the `material_ui` package instead. '
'This feature was deprecated after v3.47.',
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Flutter's deprecation policy and automated tests require the deprecation version to follow the vMajor.Minor.Patch format (three numbers separated by dots). Please update v3.47 to v3.47.0 to avoid test failures.

Suggested change
@Deprecated(
'Use the `material_ui` package instead. '
'This feature was deprecated after v3.47.',
)
@Deprecated(
'Use the "material_ui" package instead. '
'This feature was deprecated after v3.47.0.',
)

@justinmc

Copy link
Copy Markdown
Contributor Author

Closing in favor of #192957

@justinmc justinmc closed this Sep 21, 2026
@justinmc
justinmc deleted the deprecate-design branch September 21, 2026 17:29
@justinmc justinmc mentioned this pull request Sep 21, 2026
11 tasks done
@github-actions

Copy link
Copy Markdown

This pull request contains changes to Material or Cupertino, which are currently frozen in this repository.

Changes should be made in material_ui and/or cupertino_ui in the flutter/packages repository.

Please refer to #188444 for instructions.

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. CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants