Skip to content

Decoupling recopy#11888

Merged
stuartmorgan-g merged 7829 commits into
flutter:mainfrom
justinmc:decoupling-recopy
Jun 12, 2026
Merged

Decoupling recopy#11888
stuartmorgan-g merged 7829 commits into
flutter:mainfrom
justinmc:decoupling-recopy

Conversation

@justinmc

@justinmc justinmc commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

A recreate of #11669 by recopying all flutter/flutter stuff from scratch, and cherry picking all of my subsequent commits.

This is a single super mega PR attempting to migrate all Material and Cupertino code from flutter/flutter to material_ui and cupertino_ui.

How the PR was created

git filter-repo --path packages/flutter/lib/src/material --path packages/flutter/test/material --path examples/api/lib/material --path examples/api/test/material --path packages/flutter/lib/src/cupertino --path packages/flutter/test/cupertino --path examples/api/lib/cupertino --path examples/api/test/cupertino --path packages/flutter/lib/fix_data/fix_material --path packages/flutter/test_fixes/material --path packages/flutter/lib/fix_data/fix_cupertino.yaml --path packages/flutter/test_fixes/cupertino 
cd ../packages
git remote add source-origin ../flutter
git fetch source-origin
git merge source-origin/master --allow-unrelated-histories

I then cherry picked everything I could from the previous PR (#11669), skipping merge commits.

What was included in the copy

  • The main source code (packages/flutter/lib/src/<material/cupertino>).
  • The widget/unit tests (packages/flutter/test/<material/cupertino>).
  • The examples (examples/api/lib/<material/cupertino>).
  • The example tests (examples/api/test/<material/cupertino>).
  • The dart fixes (packages/flutter/lib/fix_data).
  • The dart fix tests (packages/flutter/test_fixes).

TODOs

  • Do exports for Material and Cupertino.
  • Confirm the directory structure (current plan: lib/src/ for now, reorganize after 1.0.0).
  • Try installing and using the packages locally.
  • Try running the tests locally (works except for tests with cross imports).
  • Try running the example tests locally (work after migrating package:flutter_api_samples import).
  • Verify examples work.
  • Verify that git blame appears the same in both repos on various files. (Yes, but the SHAs are different, as expected.)
  • Add auxiliary files for dart fixes and tests.
  • Port imports of material/cupertino in places like examples/test to use the new packages.
  • Fix Skip all test cross imports.
  • Make sure the analyzer is working in the same exact way as it does in flutter/flutter. (Updated analysis_options line width from flutter/flutter #11692)

Open questions

  • Are we sure about the directory structure?
  • Anything else that should be ported along with this? If these commits touch files that are not included in this PR, but that we later port in, the commits will likely have different SHAs.
    • I'm hoping we got it all at this point but if anyone notices anything let me know.
  • Do we like the examples setup?
  • Are we cool with skipping cross imports tests and fixing them later? This approach should not fracture commits because the commits were made in flutter/flutter after the code was copied.
    • Tests are in the temporarily_skipped_tests folder.

How to try using these packages

Add the local packages to your project:

flutter pub add cupertino_ui --path ../../packages/packages/cupertino_ui
flutter pub add material_ui --path ../../packages/packages/material_ui  

Then import the packages instead of the libraries in the SDK:

- import 'package:flutter/material.dart';
- import 'package:flutter/cupertino.dart';
+ import 'package:material_ui/material_ui.dart';
+ import 'package:cupertino_ui/cupertino_ui.dart';

How to review this PR

  • Do read the PR description at the top, including Open Questions.
  • Don't read all 600k+ lines changed! Ignore the main source code and test files. The only thing I changed in there is to change imports from flutter/material.dart to material_ui/material_ui.dart and the equivalent for Cupertino.
  • Do look closely at the file tree browser on the left side of the "Files Changed" tab, though. Check the directory structure of material_ui and cupertino_ui and make sure it looks good to you.
  • Do take a look at the small config files like pubspecs, analysis_options, etc.
  • See the examples and their tests now located in material_ui/material_ui_examples and cupertino_ui/cupertino_ui_examples.
  • See the data driven fixes in lib/fix_data and their tests in test_fixes.

And let me know if there is any code that's not in this PR that you expected to be. It will be best to get everything we can in this one PR rather than following up later in order to prevent fragmenting commits.

Resources

rkishan516 and others added 30 commits November 11, 2025 06:17
Feat: Add a11y for loading indicators
fixes: #161631 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.
Original PR/Discussion: flutter/flutter#172915

# Framework:
* `EditableText`/`SelectableText`, applies
`lineHeightScaleFactorOverride`, `wordSpacingOverride`, and
`letterSpacingOverride` to it's `TextStyle` similarly to how we already
do for bold platform overrides. Note `SelectableText` is built on
`EditableText` so it also applies these overrides.
* `Text`, applies `lineHeightScaleFactorOverride`,
`wordSpacingOverride`, and `letterSpacingOverride` to it's `TextStyle`
similarly to how we already do for bold platform overrides.
* Exposes line height override through
`MediaQueryData.lineHeightScaleFactorOverride` and
`maybeLineHeightScaleFactorOverrideOf(context)`.
* Exposes letter spacing override through
`MediaQueryData.letterSpacingOverride` and
`maybeLetterSpacingOverrideOf(context)`.
* Exposes word spacing override through
`MediaQueryData.wordSpacingOverride` and
`maybeWordSpacingOverrideOf(context)`.
* Exposes paragraph spacing override through
`MediaQueryData.paragraphSpacingOverride` and
`maybeParagraphSpacingOverrideOf(context)`.
* `MediaQuery.applyTextStyleOverrides()` \
`MediaQueryData.applyTextStyleOverrides()` to be able to reset/override
the text spacing settings on `MediaQueryData`.

# Engine:
* Introduces new members on `PlatformDispatcher` API that hold the text
spacing properties that are overridden on the web.
* We provide the `lineHeightScaleFactorOverride`,
`letterSpacingOverride`, `wordSpacingOverride`, and
`paragraphSpacingOverride` on the web by attaching a `ResizeObserver` to
an off-screen hidden element, when its size changes we capture its text
spacing CSS properties, and notify the framework through
`onMetricsChanged`.

Fixes #142712


https://github.com/user-attachments/assets/aaaa3e74-c232-4956-acd2-ae1a4487e415

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

---------

Co-authored-by: Renzo Olivares <roliv@google.com>
<!-- start_original_pr_link -->
Reverts: flutter/flutter#165173
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: chingjun
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: The PR did not finish "Google Testing", and
actually caused several failures in Google
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: rkishan516
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {chunhtai, flutter-zl}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Feat: Add a11y for loading indicators
fixes: #161631 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
…t (#178117)

This is my attempt to handle
flutter/flutter#6537 for the
DefaultTabController widget.
…e_list_view_builder.0.dart‎` example (#178214)

<img width="859" height="148" alt="Screenshot 2025-10-27 at 20 09 35"
src="https://github.com/user-attachments/assets/daf13a7b-a157-410a-9feb-dc466128c5a1"
/>
Similar PRs:

- #177374  
- #177490  
- #177540  
- #177541  
- #177542



## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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] All existing and new tests are passing.
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].

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

**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
[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
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

### This PR fixes #166398
- Adds focus support for `CupertinoActionSheetAction`. This makes it
work with keyboard shortcuts
- Creates new widget, `CupertinoTraversalGroup` that applies a Cupertino
style focus border around its child when any of its descendant has focus
- Employs `CupertinoTraversalGroup` in `CupertinoActionSheet`

How the new implementation looks and behaves:

https://github.com/user-attachments/assets/ea6789f1-921d-4598-bcca-489dc063ff73

How the native counterpart looks and behaves:

https://github.com/user-attachments/assets/4c6ae2a0-7205-4de2-b981-ec7f4839da6e

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
## Description

This PR adds `DropdownMenuFormField.decorationBuilder` and passes it to
the underlying `DropdownMenu`.

## Related Issue

Follow-up to flutter/flutter#176264 which added
`DropdownMenu.decorationBuilder`.

## Tests

- Adds 1 test.
## Description

This PR fixes `DropdownMenu` preferred width calculation to include the
label provided by `DropdownMenu.decorationBuilder`.

## Before

<img width="225" height="63" alt="Image"
src="https://github.com/user-attachments/assets/47dbec7d-c59c-4379-8f22-792c844f6ac4"
/>

## After

<img width="225" height="63" alt="Image"
src="https://github.com/user-attachments/assets/d4223e56-2b3f-4e12-893a-284ceb3b8ea4"
/>

## Related Issue

Fixes [DropdownMenu wrong width when decorationBuilder provides label
](flutter/flutter#178459)

## Tests

- Adds 2 tests.
…8635)

- Fix flutter/flutter#178633
- This PR is to clean API examples, improve user experience when
accessing API page

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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].

**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
[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

Signed-off-by: huycozy <huy@nevercode.io>
…pply to ModalRoute (#177570)

Fix premature dialog dismissal on Flutter Web when semantics are enabled
by correctly propagating hitTestBehavior through the semantics pipeline
and declaring modal routes as opaque to pointer events.

Before change
https://dialog-dismiss-before.web.app/

Click on the "Show Dialog" button.
Click anywhere inside the dialog that is not a form field.
Observe the dialog being dismissed.

After change
https://dialog-dimiss-after.web.app/

Click on the "Show Dialog" button.
Click anywhere inside the dialog that is not a form field.
Observe the dialog not dismissed.

Fixes: #149001
Engine work: #176974
…8618)

<img width="951" height="141" alt="Screenshot 2025-11-16 at 22 02 12"
src="https://github.com/user-attachments/assets/3aae6cfe-b5f4-41d9-a1f5-4a658894a007"
/>

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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].

**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
[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
…get and apply to ModalRoute (#177570)" (#178744)

<!-- start_original_pr_link -->
Reverts: flutter/flutter#177570
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: chingjun
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke internal tests.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: flutter-zl
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Fix premature dialog dismissal on Flutter Web when semantics are enabled
by correctly propagating hitTestBehavior through the semantics pipeline
and declaring modal routes as opaque to pointer events.

Before change
https://dialog-dismiss-before.web.app/

Click on the "Show Dialog" button.
Click anywhere inside the dialog that is not a form field.
Observe the dialog being dismissed.

After change
https://dialog-dimiss-after.web.app/

Click on the "Show Dialog" button.
Click anywhere inside the dialog that is not a form field.
Observe the dialog not dismissed.

Fixes: #149001
Engine work: #176974
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
…78156)

This is my attempt to handle
flutter/flutter#6537 for the TabPageSelector
widget.
… (#177646)

This is my attempt to handle
flutter/flutter#6537 for the
ReorderableListView widget.

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…(#178569)

`evaluate` use transform under the hood :
``` dart
T evaluate(Animation<double> animation) => transform(animation.value);
```
in that case , it is possible to use `transform` direclty:
```dart
transform(animation.value);
```

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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].

**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
[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
…454)

This is my attempt to handle
flutter/flutter#6537 for the ToggleButtons
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This is my attempt to handle
flutter/flutter#6537 for the TabBar widget.

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…… (#177978)

This is my attempt to handle
flutter/flutter#6537 for the
CupertinoSpellCheckSuggestionsToolbar widget.

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…… (#178374)

This is my attempt to handle
flutter/flutter#6537 for the
TextSelectionToolbarTextButton widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This updates Flutter to the latest release, which includes a bunch of
code cleanup that should improve compiled code size and (hopefully)
runtime performance.

The changes in flutter/flutter#153385 (discussed
in
https://docs.flutter.dev/release/breaking-changes/material-design-3-token-update)
seem to have been incomplete.

This PR effectively catches up with these changes by updating the "math"
behind primary, secondary, tertiary, error colors.

There is a pending PR on the site to update the corresponding docs:
flutter/website#12125

Fixes flutter/flutter#177285
…t (#178722)

This is my attempt to handle
flutter/flutter#6537 for the
CupertinoContextMenu widget.
…78613)

This is my attempt to handle
flutter/flutter#6537 for the CupertinoTabBar
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…… (#178566)

This is my attempt to handle
flutter/flutter#6537 for the
CupertinoLinearActivityIndicator widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…178451)

This is my attempt to handle
flutter/flutter#6537 for the TimePickerDialog
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
…… (#178516)

This is my attempt to handle
flutter/flutter#6537 for the
UserAccountsDrawerHeader widget.

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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].

**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
[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
This is my attempt to handle
flutter/flutter#6537 for the Stepper widget.

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle
flutter/flutter#6537 for the SearchAnchor
widget.

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…readablity (#178909)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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].

**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
[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
@justinmc justinmc requested a review from stuartmorgan-g June 11, 2026 22:28

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

Ah this is so very close! Exciting! 🎊

Comment thread packages/cupertino_ui/example/README.md Outdated

For example (no pun intended!), to run the first example from the
`CupertinoActivityIndicator` class in Chrome, you would run it like so from the
[api](.)

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.

Should this be api?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is where I got it from: https://github.com/flutter/flutter/blob/master/examples/api/README.md

Looks like it indeed links to the api directory, but in our case it should say "example" instead!

Comment thread packages/cupertino_ui/example/README.md Outdated
wanted to add a new example to the `CupertinoActivityIndicator` class:

```dart
/// {@tool dartpad}

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.

Nit: dartpad here could be (temporarily) misleading

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.

This is not the ultimate format based on the new @example dartdoc feature correct?

@justinmc justinmc Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, I haven't changed any of the @tool dartpad directives yet. @dkwingsmt can you advise on what those should look like now?

I'll go ahead and change this one to @example for now and plan to migrate everything else after this PR lands.

Comment thread packages/cupertino_ui/example/README.md Outdated
hasn't been used in an example before, you may have to add it to the
[pubspec.yaml](pubspec.yaml) in the [cupertino_ui_examples](./) directory.

## Snippets

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 don't think snippet or sample will be supported in these packages, we have to migrate them all to @example (not in this PR of course), and later we can add back @dartpad where it makes sense

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll remove this section.

Comment thread packages/cupertino_ui/example/README.md Outdated
snippet}`. Snippet examples are just written inline in the source, like so:

```dart
/// {@tool dartpad}

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.

This one is dartpad in the snippet docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed. Also I think we had this mistake live for a long time in https://github.com/flutter/flutter/blob/master/examples/api/README.md 😊

Comment thread packages/cupertino_ui/example/README.md Outdated
Comment on lines +146 to +150
without crashing. Functionality tests are required the examples, and generally
just do what is normally done for writing tests. The one thing that makes it
more challenging to do for examples is that they can't really be written for
testability in any obvious way, since that would complicate the examples and
make them harder to explain.

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.

Suggested change
without crashing. Functionality tests are required the examples, and generally
just do what is normally done for writing tests. The one thing that makes it
more challenging to do for examples is that they can't really be written for
testability in any obvious way, since that would complicate the examples and
make them harder to explain.
without crashing. Test coverage is required for examples, but should take care not to complicate the example strictly for the purpose of testing.

flutter_driver:
sdk: flutter
flutter_goldens:
sdk: flutter

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.

This should not use flutter_goldens from flutter/flutter.

flutter_driver:
sdk: flutter
flutter_goldens:
sdk: flutter

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.

This is flutter_goldens from flutter/flutter. It should use the implementation in flutter/packages

Comment thread packages/material_ui/lib/material_ui.dart
Comment thread packages/material_ui/pubspec.yaml Outdated
flutter_goldens:
path: ../../script/flutter_goldens
sdk: flutter

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.

Use right flutter_goldens

Comment thread packages/material_ui/pubspec.yaml Outdated

dev_dependencies:
file: any

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.

Here and the rest, replace anys

@QuncCccccc

Copy link
Copy Markdown
Contributor

The Material file structure LGTM.

Just for the record, we discussed that we don't want to move the old gen_defaults script to material_ui because we will no longer use the JSON tokens to generate default themes. We will have a new gen_default tool in material_ui generating defaults using Dart-defined tokens. The old gen_defaults tool is only used by Material, so we should gradually deprecate/remove it in dev/tools.

@justinmc

Copy link
Copy Markdown
Contributor Author

@QuncCccccc Is there anything I need to change to set up for the new gen_default tool or get rid of stuff for the old script? All of the files with tokens generated by gen_defaults still have that section at the bottom.

@justinmc justinmc force-pushed the decoupling-recopy branch from 0c30762 to 4088b5e Compare June 12, 2026 04:39
@justinmc justinmc requested a review from Piinks June 12, 2026 04:39
@justinmc justinmc added CICD Run CI/CD and removed CICD Run CI/CD labels Jun 12, 2026
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

The commit structure LG this time. I would recommend amending 4088b5e though, to make the first line more descriptive (e.g., "[cupertino_ui,material_ui] Post-import adjustments for new package-based structure"), and to make the body a real summary of what meaningfully changed rather than a raw log of incremental commit messages. (See a1bfadf for example.)

  • Do we like the examples setup? Separate package at material_ui_examples that points to material_ui via the pubspec workspace. Similar to how flutter/flutter's flutter_api_samples works.

Is this part of the PR description obsolete? I just see the standard example/ subdir (which is what I would expect absent a strong reason to do something different).

  • See the examples and their tests now located in material_ui/material_ui_examples and cupertino_ui/cupertino_ui_examples.

Same; this doesn't seem to match the current state.

@justinmc justinmc force-pushed the decoupling-recopy branch from 4088b5e to 0d08b30 Compare June 12, 2026 15:58
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 12, 2026
@justinmc

Copy link
Copy Markdown
Contributor Author
  • ✅ Commit description updated.
  • ✅ PR description "Open Questions" updated. I think we're good on these now but let me know if anyone still has anything to discuss.

@justinmc justinmc added the CICD Run CI/CD label Jun 12, 2026
@justinmc justinmc force-pushed the decoupling-recopy branch from 0d08b30 to 0840d3e Compare June 12, 2026 16:27
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 12, 2026

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

the structure LGTM besides the open comments. There should be a main.dart in example which will be used by the pub dev. but that can wait until the first release

- "temporarily_disabled_tests/**"

formatter:
page_width: 100

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.

is this still needed that the repo is 100 width across?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, good catch!

- "temporarily_disabled_tests/**"

formatter:
page_width: 100

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.

same


environment:
sdk: ^3.12.0
resolution: workspace

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless you've specifically set up workspaces at the package level, this should be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did, I've got this line in both of the main pubspecs:

workspace:
  - example

This is how it was done in the main flutter/flutter repo. It seems useful especially since these example packages import their parent packages. But if there's a downside let me know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't want to do anything risky with this PR so if it's easier to just remove it and think about this later then I'm happy to do so.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know of any downside offhand since I haven't really experimented with them yet. If it works, that's fine (we can alway remove it later if we find problems). I just wanted to make sure it wasn't accidental holdover from the mega-workspace in flutter/flutter.

sdk: ^3.12.0
flutter: ">=3.44.0"

workspace:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here and anywhere else; we should remove any workspace entries unless you are deliberately configuring them. We currently don't use workspaces anywhere else in this repo (it's something that I plan to look into at some point, but haven't yet.)

@justinmc justinmc Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Discussion above at: #11888 (comment)

@justinmc justinmc force-pushed the decoupling-recopy branch from 0840d3e to bfe1ef4 Compare June 12, 2026 17:15
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 12, 2026
@justinmc justinmc added CICD Run CI/CD and removed CICD Run CI/CD labels Jun 12, 2026
…sed structure.

A single squashed commit of all work after copying the Material and
Cupertino libraries, and related code, into material_ui and
cupertino_ui. Puts the code in the right place and sets it all up
properly in the new repo so that it passes CI.

 * Copied code was moved to material_ui and cupertino_ui.
 * Imports of flutter/material.dart and flutter/cupertino.dart were
   changed to material_ui/material_ui.dart and
   cupertino_ui/cupertino_ui.dart, respectively.
 * Relative imports were updated to new paths or packages to work in
   their new location.
 * The flutter_goldens package was referenced from
   script/flutter_goldens instead of the flutter/flutter sdk version.
 * Dependencies referenced with `any` version were updated to the
   caret version in flutter/flutter's lock file.
 * Examples were set up as their own packages in the `example` directory.
 * READMEs were updated to be consistent with the new setup.
 * Pubspecs were updated to work with the new setup. Set to Flutter
   3.44.0, which is the stable version first containing the code freeze.
 * Dart data-driven fixes were set up in the fix_data directories along
   with their tests in the test_fixes directories.
 * Doc imports were updated to work in the new setup.
 * One dart fix test was removed since it was already tested in
   flutter/flutter's widgets library.
 * The drag_target dart fix was deleted and kept in flutter/flutter.
 * Other widgets-only dart fixes were deleted in cupertino_ui for the
   same reason.
 * Tests with cross imports were skipped and moved to the
   temporarily_skipped_tests directories, to be fixed before 1.0.0.
 * Formatting was adjusted to pass analysis here.
 * A usage of flutter_test's byTooltip finder was removed since it
   contains a cross import of material.
 * License headers were updated to match this repository.
 * Batch release was disabled for now (until we're ready to release
   1.0.0).
 * Exceptions were added for some pinned dependencies that came from
   flutter/flutter.
 * Some fixes and skips were added to the example tests in order to be
   able to run them on Chrome. It seems that these tests were never run
   on web in flutter/flutter.
@justinmc justinmc force-pushed the decoupling-recopy branch from bfe1ef4 to 7ffe1f1 Compare June 12, 2026 17:38
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 12, 2026
@justinmc justinmc added the CICD Run CI/CD label Jun 12, 2026
@justinmc

Copy link
Copy Markdown
Contributor Author

the structure LGTM besides the open comments. There should be a main.dart in example which will be used by the pub dev. but that can wait until the first release

I've created an issue for the examples: flutter/flutter#187942

@QuncCccccc

Copy link
Copy Markdown
Contributor

@QuncCccccc Is there anything I need to change to set up for the new gen_default tool or get rid of stuff for the old script? All of the files with tokens generated by gen_defaults still have that section at the bottom.

For new gen_default tool, nothing needed to change or setup ahead of time. We will later land this PR in material_ui.

For old script, nothing needed to get rid of in this PR. The defaults should be gradually migrated to use the new gen_defaults. But we should not remove anything for now.

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

More than ever before, this
Flutter_LGTM

@stuartmorgan-g stuartmorgan-g merged commit 0346a5d into flutter:main Jun 12, 2026
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: material_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.