Skip to content

Decoupling Material and Cupertino (with dart fixes)#11669

Open
justinmc wants to merge 7851 commits intoflutter:mainfrom
justinmc:decoupling-material-and-cupertino-and-fixes
Open

Decoupling Material and Cupertino (with dart fixes)#11669
justinmc wants to merge 7851 commits intoflutter:mainfrom
justinmc:decoupling-material-and-cupertino-and-fixes

Conversation

@justinmc
Copy link
Copy Markdown
Contributor

@justinmc justinmc commented May 7, 2026

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

To create this PR I used:

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 (#11568).

For both Material and Cupertino, I'm importing:

  • 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.
  • Make sure the analyzer is working in the same exact way as it does in flutter/flutter.
  • Fix all test cross imports, or decide to merge this without them and fix later. Can these fixes be ported afterwards? The problem of partial commit SHAs shouldn't apply to these new things.

Open questions

  • Are we sure about the directory structure?
    • What happens when a user imports material_ui.dart and there are things with the same name in both m3 and m3e?
  • 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.
  • 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.

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';

Resources

ahmedsameha1 and others added 30 commits November 22, 2025 01:05
…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
This is a reland of #177570, which was reverted in #178744 due to test
failures.

The original PR introduced `hitTestBehavior` to the semantics framework
but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked
platform views from receiving pointer events.

Instead of making the entire modal opaque, we:
1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to
`defer`)
2. Make only the dialog/sheet content opaque (blocks clicks to barrier)
3. Platform views remain clickable because they're outside the opaque
content boundary

Fixes #149001
Original PR: #177570
Revert: #178744
…8817)" (#179100)

<!-- start_original_pr_link -->
Reverts: flutter/flutter#178817
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: Piinks
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: change was landed during tree closure
<!-- 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:
This is a reland of #177570, which was reverted in #178744 due to test
failures.

The original PR introduced `hitTestBehavior` to the semantics framework
but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked
platform views from receiving pointer events.

Instead of making the entire modal opaque, we:
1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to
`defer`)
2. Make only the dialog/sheet content opaque (blocks clicks to barrier)
3. Platform views remain clickable because they're outside the opaque
content boundary

Fixes #149001
Original PR: #177570
Revert: #178744

<!-- end_revert_body -->

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

Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues 
- Run `dart format .` in the right places.

Local analysis and testing passes. Checking CI now.

Part of flutter/flutter#178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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
I recommend reviewing each commit individually.

The following were suppressed instead of migrated to minimize the time
the tree is closed:

1. The [`Radio` -> `RadioGroup`
migration](https://docs.flutter.dev/release/breaking-changes/radio-api-redesign).
Tracked by: flutter/flutter#179088.

Part of: flutter/flutter#178827

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

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
…… (#178565)

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

This PR updates some comments in AppBar, Banner and BottomAppBar to
reflect the changes related to Theme normalization.

## Related Issue

Related to flutter/flutter#91772

## Tests

- Documentation only
- Fix flutter/flutter#178719
- See
flutter/flutter#178719 (comment)
for details of debugging and proposal.

<details open>
<summary>Demo (after the fix)</summary>


https://github.com/user-attachments/assets/cecb470f-d98c-47b0-a34d-fc858cfb0dd4
</details>


## 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 `///`).
- [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].

**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>
This change fixes a crash in `EditableText` that occurs when the text
editing value changes between two scrolls, when the second scroll ends
`_dataWhenToolbarShowScheduled` will be invalidated. If the second
scroll ends before the post frame callback scheduled by the first scroll
has a chance to execute, there will be a crash because
`_dataWhenToolbarShowScheduled` is being accessed while null.

This change also invalidates a scheduled toolbar if the text editing
value has changed before the post-frame callback has a chance to run.

Fixes #179164

## 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>
Migrates some - but not all - samples to use the new `RadioGroup`
widget.

See:
[https://docs.flutter.dev/release/breaking-changes/radio-api-redesign](https://docs.flutter.dev/release/breaking-changes/radio-api-redesign)

Part of: flutter/flutter#179088

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

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
…on (#179404)

## Description

This PR updates [BottomNavigationBar.selectedItemColor] and
[BottomNavigationBar.unselectedItemColor] documentation to reflect the
changes related to theme normalization.
It also fixes the [BottomNavigationBar.selectedItemColor] documentation
to mention the correct default values.

## Related Issue

Related to flutter/flutter#91772

## Tests

- Documentation only
## Description

This PR adds `DropdownMenu.selectOnly`. This property allows users to
get the DropdownMenu behave as a 'select' component.
It is meant as a future replacement for
`DropdownMenu.requestFocusOnTap`.

## Motivation

On mobile, a dropdown menu widget is usually used as a ‘select’ widget
because opening the keyboard for searching/filtering is not convenient.

In Flutter, this is currently implemented through
`DropdownMenu.requestFocusOnTap` which defaults to false on mobile and
true on desktop.
The `DropdownMenu.requestFocusOnTap` property is currently used to set
`FocusNode.canRequestFocus`. This leads do difficulties mainly related
to focus traversal:
- Keyboard traversal requires workarounds (for instance relying on the
trailing icon to be focusable).
- Keyboard shortcuts require also a workaround (currently relying on a
Focus widget in a Stack).
- The `DropdownMenu` decoration does not reflect the focus state.

This PR proposes a new property named `DropdownMenu.selectOnly` which
does not require `DropdownMenu.requestFocusOnTap` to be false to make
the `DropdownMenu` behave like a select widget.

With this property the `DropdownMenu`:
- Supports keyboard navigation on mobile and desktop.
- Has a correct decoration when focused.
- Does not rely on the trailing icon to be focusable (see
flutter/flutter#174096).

In the future this property could be used as a replacement for
`DropdownMenu.requestFocusOnTap`. For the moment, for compatibility, it
does not replace `DropdownMenu.requestFocusOnTap`.

## Related Issue

Fixes [Allow DropdownMenu to be non-editable and focusable (select
control) ](flutter/flutter#178009)
Also related to [Make DropdownMenu's trailing icon not focusable by
default](flutter/flutter#174096) and
[[Material3] DropdownMenu Keyboard
Accessibility](flutter/flutter#123797).


## Tests

- Adds 9 tests.
…om Android 12. (#173849)

Fixed an issue #169659

This PR improves the StretchingOverscrollIndicator to better match
native Android behavior.

- Previously, the stretch effect worked well only for slow dragging, and
during fast flings it was absent or felt clipped.
- Implemented a Simulation-based animation that responds naturally to
both slow drags and high-velocity flings.
- The result closely resembles the native Android overscroll behavior
while maintaining Flutter's performance characteristics.

This change ensures that momentum-based gestures produce a more natural
and intuitive overscroll experience, especially for users accustomed to
native Android scroll views.

## Fling

[fling](https://github.com/user-attachments/assets/3944eef3-baaa-47df-82ca-9c49d4283fe4)

## Pull And Reduce
Also, a very similar animation is implemented when pulling as well.


[pull](https://github.com/user-attachments/assets/2a3025dc-0996-403d-b58b-d07f25487cda)

## 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: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
## Description

This PR updates some comments in various widgets to reflect the changes
related to Theme normalization.

## Related Issue

Related to flutter/flutter#91772

## Tests

- Documentation only
…(#179442)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#178857)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…78629)

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

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

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

This is my attempt to handle
flutter/flutter#6537 for the CupertinoCheckbox
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 #179094.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#179235)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…… (#179165)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…t (#178858)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 7, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels May 7, 2026
@justinmc justinmc mentioned this pull request May 7, 2026
9 tasks
@github-actions github-actions Bot removed the CICD Run CI/CD label May 7, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 7, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 7, 2026
drag_target deleted because it is widgets-only.

Many widgets-only fixes were removed from cupertino.dart.
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 7, 2026
@justinmc
Copy link
Copy Markdown
Contributor Author

justinmc commented May 7, 2026

@Piinks I've created a new PR to include the dart fixes, which was easy enough. I spent some time cleaning up the dart fixes so they use the new imports. As of right now all the tests pass:

cd packages/material_ui/test_fixes # Or packages/cupertino_ui/test_fixes
dart fix --compare-to-golden

However I did remove some fixes that seemed to be related exclusively to the Widgets library. Those are still covered in flutter/flutter.

@Piinks Piinks added CICD Run CI/CD and removed CICD Run CI/CD labels May 8, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 8, 2026
@justinmc justinmc marked this pull request as ready for review May 8, 2026 22:19
@justinmc justinmc added the CICD Run CI/CD label May 8, 2026
Copy link
Copy Markdown

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

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 transitions the Cupertino library into a standalone package, incorporating source code for core widgets, a comprehensive set of API examples, and a robust suite of tests. It also adds dart fix metadata to assist with future migrations. Feedback identifies critical issues in dialog.dart where undefined classes and properties are used, along with pervasive syntax errors in the example files regarding enum member references. Additionally, several components are missing definitions, and the SDK constraint in the examples' pubspec.yaml must be updated to support the features used in the code.


// TODO(davidhicks980): Set `bounded` to true on ImageFilterConfig.blur after
// https://github.com/flutter/flutter/issues/182066 is resolved.
ImageFilterConfig? _buildFilter(Brightness? brightness) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

ImageFilterConfig is not a standard Flutter or Dart class, and it is not defined in this package. It appears to be a typo for ImageFilter. Additionally, BackdropFilter does not have a filterConfig property; it should be filter.

  ImageFilter? _buildFilter(Brightness? brightness) {

return ClipRSuperellipse(
borderRadius: _clipper,
child: BackdropFilter(filterConfig: filter, child: contents),
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The BackdropFilter widget uses the filter property, not filterConfig.

        child: BackdropFilter(filter: filter, child: contents),

@override
Widget build(BuildContext context) {
return const CupertinoApp(
theme: CupertinoThemeData(brightness: .light),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The syntax .light is invalid in Dart for referring to an enum member in this context. It should be Brightness.light. This issue is pervasive throughout the example files (e.g., .center, .spaceEvenly, .all, .only, .symmetric, .date, .time, .w600).

Suggested change
theme: CupertinoThemeData(brightness: .light),
theme: const CupertinoThemeData(brightness: Brightness.light),

/// This example shows how to use [CupertinoExpansionTile] with different transition modes.
///
/// ** See code in examples/api/lib/cupertino/expansion_tile/cupertino_expansion_tile.0.dart **
/// {@end-tool}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

ExpansibleController and Expansible are used but not defined in this file, nor are they imported from any of the dependencies. If these are intended to be part of the package, they should be included in the source code.

SingingCharacter? _character = .lafayette;

@override
Widget build(BuildContext context) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

RadioGroup is not a standard Flutter widget and is not defined in the provided patches. If it is a custom widget intended for this package, ensure its definition is included.

version: 1.0.0

environment:
sdk: ^3.10.0-0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The SDK constraint is too low for the features used in this package, such as withValues, ColorSpace, and ClipRSuperellipse. It should be updated to at least ^3.22.0 or higher.

  sdk: ^3.22.0

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:material_ui/material_ui.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This import is redundant as FlutterLogo is available via package:cupertino_ui/cupertino_ui.dart (which exports widgets.dart).

@github-actions github-actions Bot removed the CICD Run CI/CD label May 8, 2026
@justinmc justinmc added the CICD Run CI/CD label May 8, 2026
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.