Skip to content

Migrate flutter create templates to material_ui - #192947

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
Piinks:depDesign
Sep 18, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
Piinks:depDesign

Conversation

@Piinks

@Piinks Piinks commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This migrates the flutter create templates to use material_ui instead of flutter/material.dart.

This was surprisingly easy... maybe I am missing something? 🙃

Pre-launch Checklist

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. 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.

@Piinks
Piinks requested review from bkonyi and justinmc September 17, 2026 20:41
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 17, 2026
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 17, 2026

@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 replaces the standard package:flutter/material.dart import with package:material_ui/material_ui.dart and adds material_ui as a dependency in the default Flutter application templates. The review feedback advises reverting these changes, noting that default Flutter templates should rely on the built-in SDK package rather than introducing external dependencies.

Comment thread packages/flutter_tools/templates/app/lib/main.dart.tmpl
Comment thread packages/flutter_tools/templates/app/pubspec.yaml.tmpl
Comment thread packages/flutter_tools/templates/app/pubspec.yaml.tmpl

@bkonyi bkonyi 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.

I can't think of anything else that needs to be updated off the top of my head. LGTM, assuming the checks all pass 😁

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 17, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 18, 2026
Merged via the queue into flutter:master with commit f13bf48 Sep 18, 2026
28 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 18, 2026
aayushkedawat pushed a commit to aayushkedawat/flutter that referenced this pull request Sep 21, 2026
…d` to `[material|cupertino]_ui` (flutter#193099)

Follow-up to flutter#192947 in preparation for deprecating
`package:flutter/material.dart` and `package:flutter/cupertino.dart`
Part of un-blocking flutter#192957

This PR migrates the remaining `flutter_tools` templates and test
fixtures that run `flutter analyze` so they do not trigger
`deprecated_member_use` diagnostics when the design libraries in
`package:flutter` are deprecated:

1. **module template**:
- Migrates `lib/main.dart.tmpl` and `test/widget_test.dart.tmpl` to
`material_ui`.
2. **widget_preview_scaffold**:
- Migrates the `widget_preview_scaffold` template files, hydrated
scaffold sources, and tests to `material_ui` and `cupertino_ui`.
3. **analyze_once_test.dart **:
- Migrates the synthetic `mainDartSrc` fixture from
`package:flutter/material.dart` to `package:flutter/widgets.dart`
(`WidgetsApp`), since `createDotPackages()` constructs a minimal
`.dart_tool/package_config.json` containing only `flutter` and
`sky_engine`.

## 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 in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [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
[flutter/website]: https://github.com/flutter/website
[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

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants