4408 Commits

Author SHA1 Message Date
Bruno Leroux
c093967de2
Fix DropdownMenu escape key does not close the menu (#178002)
## Description

This PR fixes escape key not closing the menu when
`DropdownMenu.requestFocusOnTap` is false.

## Related Issue

Fixes [DropdownMenu menu panel does not close when pressing ESC and
requestFocusOnTap is
false](https://github.com/flutter/flutter/issues/177993)
Part of https://github.com/flutter/flutter/issues/123797
 
## Tests

- Adds 3 tests.
- Updates 2 non-related tests where I spotted some nits.
2025-11-06 10:34:26 +00:00
Lau Ching Jun
f066ed6591
Revert "Refactor OverlayPortal semantics (#173005)" (#178007)
This reverts commit ccf6466b14e144971a7d65983bdd16459d65a62a.

~This is a test PR for investigation, the commit seems to be breaking a
customer app.~

The original PR caused b/457553134
2025-11-06 03:41:26 +00:00
Jaineel Mamtora
8892bc8fed
fix: inconsistent horizontal spacing between hours and mins in time picker for non-english language (#173706)
<!--
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 aims to fix an open issue:
https://github.com/flutter/flutter/issues/173621

## 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

## Screenshots

Please find below the _before_ and _after_ screenshots 

- Before
<img width="294" height="264" alt="before_fixing_spacing"
src="https://github.com/user-attachments/assets/ce519c72-cb5e-4f08-8976-abb01f9eb76d"
/>

- After
<img width="294" height="261" alt="after_fixing_spacing"
src="https://github.com/user-attachments/assets/f010cbbf-680d-495b-a028-16c7fbdb9a09"
/>


<!-- 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>
2025-11-05 22:15:32 +00:00
Ahmed Mohamed Sameh
43f7a1ea1b
Make sure that a SnackBarAction doesn't crash in 0x0 environment (#177899)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the SnackBarAction
widget.
2025-11-03 21:30:23 +00:00
Ahmed Mohamed Sameh
77920e15d7
Make sure that a SelectionArea doesn't crash in 0x0 environment (#177876)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the SelectionArea
widget.
2025-11-03 21:30:22 +00:00
Ahmed Mohamed Sameh
4d10e0c169
Make sure that GridTile doesn't crash in 0x0 environment (#175321)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the GridTile widget.

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 19:44:08 +00:00
Ahmed Mohamed Sameh
0908c2e225
Make sure that a Slider doesn't crash in 0x0 environment (#177882)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Slider widget.
2025-11-03 19:42:15 +00:00
Ahmed Mohamed Sameh
8e567b884d
Make sure that a CheckedPopupMenuItem doesn't crash in 0x0 environment (#177545)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
CheckedPopupMenuItem widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 18:08:25 +00:00
Ahmed Mohamed Sameh
f07d882efb
Make sure that a PopupMenuItem doesn't crash in 0x0 environment (#177533)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the PopupMenuItem
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 06:40:30 +00:00
Ahmed Mohamed Sameh
50d03ed339
Make sure that a RefreshProgressIndicator doesn't crash in 0x0 enviro… (#177556)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
RefreshProgressIndicator widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 06:36:25 +00:00
Ahmed Mohamed Sameh
902a697692
Make sure that a PopupMenuButton doesn't crash in 0x0 environment (#177493)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the PopupMenuButton
widget.

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 01:25:24 +00:00
Ahmed Mohamed Sameh
4499cf6e89
Make sure that a CircularProgressIndicator doesn't crash in 0x0 envir… (#177555)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
CircularProgressIndicator widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-03 01:21:38 +00:00
Ahmed Mohamed Sameh
518722ab1a
Make sure that a Radio doesn't crash in 0x0 environment (#177580)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Radio widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 22:18:03 +00:00
Ahmed Mohamed Sameh
f311a23424
Make sure that a RadioListTile doesn't crash in 0x0 environment (#177576)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the RadioListTile
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:40:50 +00:00
Ahmed Mohamed Sameh
9c056ed84e
Make sure that an ExpandIcon doesn't crash in 0x0 envrionment (#175042)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the ExpandIcon
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:39:35 +00:00
Ahmed Mohamed Sameh
ab479438cf
Make sure that a RangeSlider doesn't crash in 0x0 environment (#177642)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the RangeSlider
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:25:57 +00:00
Ahmed Mohamed Sameh
b0f5cda78e
Make sure that a GridTileBar doesn't crash in 0x0 environment (#177546)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the GridTileBar
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:25:57 +00:00
Ahmed Mohamed Sameh
647ce0c00a
Make sure that a LinearProgressIndicator doesn't crash in 0x0 environ… (#177553)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
LinearProgressIndicator widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:25:56 +00:00
Ahmed Mohamed Sameh
6a3011b4e1
Make sure that a PopupMenuDivider doesn't crash in 0x0 environment (#177445)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the PopupMenuDivider
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:05:34 +00:00
Ahmed Mohamed Sameh
71ac4b2fdb
Make sure that a PaginatedDataTable doesn't crash in 0x0 environment (#177389)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
PaginatedDataTable widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:04:03 +00:00
Ahmed Mohamed Sameh
a52e28e0cd
Make sure that an OutlinedButton doesn't crash in 0x0 environment (#177340)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the OutlinedButton
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 20:01:55 +00:00
Ahmed Mohamed Sameh
285e6f06ad
Make sure that a MenuAnchor doesn't crash in 0x0 environment (#176302)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the MenuAnchor
widget.

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 19:59:05 +00:00
Ahmed Mohamed Sameh
604bc866a4
Make sure that a CheckboxListTile doesn't crash in 0x0 environment (#173151)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the CheckboxListTile
UI control.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 19:57:01 +00:00
Ahmed Mohamed Sameh
93999e1edb
Make sure that an IconButton doesn't crash in 0x0 environment (#175372)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the IconButton
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 19:55:45 +00:00
Ahmed Mohamed Sameh
95900da253
Make sure that an ElevatedButton doesn't crash in 0x0 environment (#175006)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the ElevatedButton
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 19:55:45 +00:00
Ahmed Mohamed Sameh
c30e5d4161
Make sure that a FilledButton doesn't crash in 0x0 environment (#175110)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the FilledButton
widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-11-02 19:54:57 +00:00
Ahmed Mohamed Sameh
46c3f84370
Make sure that a SegmentedButton doesn't crash in 0x0 environment (#177773)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the SegmentedButton
widget.
2025-11-02 19:53:57 +00:00
Ahmed Mohamed Sameh
15d2e56b4e
Make sure that a SearchBar doesn't crash in 0x0 environment (#177761)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the SearchBar widget.
2025-11-02 19:52:00 +00:00
Ahmed Mohamed Sameh
5e348fd892
Make sure that a Scaffold doesn't crash in 0x0 environment (#177722)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Scaffold widget.
2025-11-02 19:33:46 +00:00
Ahmed Mohamed Sameh
dc7da2b3fe
Make sure that a Scrollbar doesn't crash in 0x0 environment (#177724)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Scrollbar widget.
2025-11-02 19:33:46 +00:00
Bruno Leroux
be736e19e7
Fix default value for DateRangePickerDialog currentDate (#177448)
## Description

This PR fixes the default value for `DateRangePickerDialog.currentDate`.
Before this PR, the comment mentions that `currentDate` defaults to
`DateTime.now()` but this is not the case (the value is not
initialised).
After this PR, `currentDate` defaults to `calendarDelegate.now()`.

## Related Issue

Fixes [DateRangePickerDialog crashes when currentDate is
omitted](https://github.com/flutter/flutter/issues/177441)

## Tests

- Adds 1 test
2025-10-31 22:16:21 +00:00
Bruno Leroux
46b6f40982
Fix ElevatedButton.icon breaks focus traversal and VoiceOver when toggling icon (#177579)
## Description

This PR changes `ElevatedButton.icon` to avoid building a different
widget. When a different widget is created the whole subtree is
recreated which leads to various issues (Focus and A11y issues for
instance).
The change is similar to https://github.com/flutter/flutter/pull/175810
which fixed the exact same problem for `OutlinedButton.icon`.

## Related Issue

[TextButton.icon breaks focus traversal and ink effect when toggling
icon](https://github.com/flutter/flutter/issues/173944)
[Voiceover focus traversal breaks if a button's state changes to include
an icon](https://github.com/flutter/flutter/pull/175810)

## Tests

- Adds 2 tests
2025-10-31 15:01:19 +00:00
Bruno Leroux
46733c69fb
Fix FilledButton.icon and FilledButton.tonalIcon break focus traversal and VoiceOver (#177593)
## Description

This PR changes `FilledButton.icon` and `FilledButton.tonalIcon` to
avoid building a different widget. When a different widget is created
the whole subtree is recreated which leads to various issues (Focus and
A11y issues for instance).
The change is similar to https://github.com/flutter/flutter/pull/175810
which fixed the exact same problem for `OutlinedButton.icon`.

## Related Issue

[TextButton.icon breaks focus traversal and ink effect when toggling
icon](https://github.com/flutter/flutter/issues/173944)
[Voiceover focus traversal breaks if a button's state changes to include
an icon](https://github.com/flutter/flutter/pull/175810)

## Tests

- Adds 4 tests
2025-10-31 13:06:24 +00:00
Qun Cheng
ccf6466b14
Refactor OverlayPortal semantics (#173005)
Fixes https://github.com/flutter/flutter/issues/163576
Fixes https://github.com/flutter/flutter/issues/175184

This PR refactored the grafting part on `OverlayPortal`. Originally, the
semantics tree of `OverlayPortal` was constructed/grafted in render
object phase to make sure the correctness of the traversal order.
However this resulted wrong hit-test order and the issue surfaced on
web. With the fact that on web we are not able to graft/correct hit-test
order tree, this PR:
* Reverts the original grafting of the `OverlayPortal` so the hit-test
order is always correct.
* Then, we adds the grafting and updates the traversal order when we
send `childrenInTraversalOrder` to engine.
* Updating `childrenInTraversalOrder` causes it have different length
from the length of `childrenInHitTestOrder` and wrong hit-test transform
of the `OverlayPortal` children because when the transform is
calculated, it assumes a correct traversal order. To fix these issues,
this PR also:
  * recalculates the transform for `OverlayPortal` children.
  * adds `hitTestTransform` property and pass it to Android engine.
* skip grafting for web because it assumes the same length of
`childrenInTraversalOrder` and `childrenInHitTestOrder`.
* added grafting by using `ARIA-owns` in web engine to fix the traversal
order.

## 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.
2025-10-29 22:30:39 +00:00
Bruno Leroux
c059c9b7da
Fix TextButton.icon breaks focus traversal and ink effect when toggling icon (#176579)
## Description

This PR changes `TextButton.icon` to avoid building a different widget.
When a different widget is created the whole subtree is recreated which
leads to various issues (Focus and A11y issues for instance).
The change is similar to https://github.com/flutter/flutter/pull/175810
which fixed the exact same problem for `OutlinedButton.icon`.

## Related Issue

Fixes [TextButton.icon breaks focus traversal and ink effect when
toggling icon](https://github.com/flutter/flutter/issues/173944)

## Tests

- Adds 1 test

---------

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
2025-10-28 22:07:10 +00:00
Mohellebi abdessalem
5d49a38d58
Replace opacity from random color in navigation bar test (#177490)
same as #177374 and #177205

## 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 added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).

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
2025-10-28 22:03:13 +00:00
Huy
a9b22cf7ba
Fix AppBar Semantics namesRoute for mismatched platforms (#176694)
- Address a partial issue within
https://github.com/flutter/flutter/issues/176566
- Fix https://github.com/flutter/flutter/issues/177000
- In this PR:
- proposes using `defaultTargetPlatform` instead of platform from theme
for Semantics namesRoute in AppBar widget (see use case at
https://github.com/flutter/flutter/issues/176566#issue-3486244630);
- improve documentation for this at `excludeHeaderSemantics` property.
    -  add a test for this change.

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

---------

Signed-off-by: huycozy <huy@nevercode.io>
2025-10-28 06:58:20 +00:00
Huy
c648d8941b
Fix Popup menu Semantics label for mismatched platforms (#177049)
- Address a partial issue within
https://github.com/flutter/flutter/issues/176566
- Fix  https://github.com/flutter/flutter/issues/177003
- In this PR:
- proposes using `defaultTargetPlatform` instead of platform from theme
for Semantics label in _PopupMenu widget
    -  add some new tests

## 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>
2025-10-28 06:02:24 +00:00
Ahmed Mohamed Sameh
673023b2e0
Make sure that a DropdownMenu doesn't crash in 0x0 environment (#174809)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the DropdownMenu
widget.
2025-10-25 16:06:33 +00:00
Bruno Leroux
b05f001129
Fix DropdownMenu filtering is broken (#177450)
## Description

This PR fixes `DropdownMenu` filtering.
This is mainly a revert of
https://github.com/flutter/flutter/pull/162062.
It adds a test to avoid a similar regression in the future.

It will reeopen https://github.com/flutter/flutter/issues/155660. A
future PR will try to fix that issue.

See
https://github.com/flutter/flutter/pull/174757#issuecomment-3430614390
for more context.

## Related Issue

Fixes [DropdownMenu filtering is
broken](https://github.com/flutter/flutter/issues/174609)
Reeopens [DropdownMenu.didUpdateWidget should re-match initialSelection
when dropdownMenuEntries have
changed](https://github.com/flutter/flutter/issues/155660)

## Tests

Adds 1 test.
Removes 3 tests (reverted tests from
https://github.com/flutter/flutter/pull/162062).
2025-10-25 10:57:22 +00:00
Huy
78c9a49616
Fix bottom sheet Semantics route label for mismatched platforms (#177094)
- Address a partial issue within
https://github.com/flutter/flutter/issues/176566
- Fix  https://github.com/flutter/flutter/issues/177004
- In this PR:
- proposes using `defaultTargetPlatform` instead of platform from theme
for Semantics label in _ModalBottomSheet widget
    -  add some new tests

## 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>
2025-10-24 04:54:23 +00:00
Huy
f0c6378bb5
Fix Dialog Semantics label and flags for mismatched platforms (#176781)
- Address a partial issue within
https://github.com/flutter/flutter/issues/176566
- Fix  https://github.com/flutter/flutter/issues/177001
- In this PR:
- proposes using `defaultTargetPlatform` instead of platform from theme
for Semantics title's `label` and `namesRoute` flag in AlertDialog and
SimpleDialog widgets (see use case at
https://github.com/flutter/flutter/issues/176566#issue-3486244630);
    - improve documentation on each widget for more accessible to users
- add some new tests for this change, and also update existing tests.

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

---------

Signed-off-by: huycozy <huy@nevercode.io>
2025-10-24 03:52:24 +00:00
Huy
60f4f9ffdd
Fix drawer Semantics for mismatched platforms (#177095)
- Address a partial issue within
https://github.com/flutter/flutter/issues/176566
- Fix  https://github.com/flutter/flutter/issues/177005
- In this PR:
- proposes using `defaultTargetPlatform` instead of platform from theme
for Semantics label in Drawer widget
    -  add some new tests

## 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>
2025-10-24 03:48:25 +00:00
Camille Simon
7fd228f31d
[Material] Change default mouse cursor of buttons to basic arrow instead of click (except on web) (#171796)
Changes default mouse cursor of Material buttons to basic arrow instead
of click as per updated Android guidance.

For each Material button, I did the following:

1. Changed the default mouse cursor to the basic arrow.
2. Added a way to configure the mouse cursor of the button if a method
did not exist before.
3. Added a test to ensure that the default mouse cursor is now the basic
arrow (or modified an existing one if applicable).
4. Added a test to ensure that the customization of button mouse cursors
still works (if currently untested).

The list of Material buttons I modified (supposed to be all of them):

- RawMaterialButton
- DropdownButton
- FloatingActionButton
- ToggleButtons
- ElevatedButton
- IconButton
- FilledButton
- OutlinedButton
- PopupMenuItem
- InkWell
- TextButton
- MaterialButton
- DropdownMenuItem
- DropdownButtonFormField
- BackButton
- CloseButton
- DrawerButton
- EndDrawerButton
- PopupMenuButton
- MenuItemButton
- CheckboxMenuButton
- RadioMenuButton
- MenuBar
- SubmenuButton
- SegmentedButton
- FilterChip
- ChoiceChip
- ActionChip
- InputChip

Fixes https://github.com/flutter/flutter/issues/170296.

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

<!-- 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>
2025-10-23 22:24:00 +00:00
Kishan Rathore
adb383b884
refactor: migrate OpenUpwardsPageTransitionsBuilder to widgets (#177080)
Changes:

* Move OpenUpwardsPageTransitionsBuilder from
`material/page_transitions_theme.dart` to
`widget/page_transitions_builder.dart`
* Replace `Colors.black` with `const Color(0xFF000000)` in
_OpenUpwardsPageTransition until framework colors are available(if we
add).

part of: https://github.com/flutter/flutter/issues/172929

## 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.
2025-10-22 18:07:08 +00:00
Bruno Leroux
9cf179b88d
Fix InputDatePickerFormField does not inherit local InputDecorationTheme (#177090)
## Description

This PR replaces global `ThemeData.inputDecorationTheme` usage in
`InputDatePickerFormField` with `InputDecorationTheme.of ` which returns
the ambient `InputDecorationTheme`.
It is a follow up to https://github.com/flutter/flutter/pull/168981
which introduces `InputDecorationTheme.of `.

## Related Issue

Fixes [InputDatePickerFormField does not inherit local
InputDecorationTheme](https://github.com/flutter/flutter/issues/177088)

## Tests

- Adds 1 test
2025-10-22 07:51:42 +00:00
Bruno Leroux
b25ec17582
Fix DateRangePickerDialog does not inherit local InputDecorationTheme (#177086)
## Description

This PR replaces global `ThemeData.inputDecorationTheme` usage in
`DateRangePickerDialog` with `InputDecorationTheme.of ` which returns
the ambient `InputDecorationTheme`.
It is a follow up to https://github.com/flutter/flutter/pull/168981
which introduces `InputDecorationTheme.of `.

## Related Issue

Fixes [DateRangePickerDialog does not inherit local
InputDecorationTheme](https://github.com/flutter/flutter/issues/177083)

## Tests

- Adds 1 test
2025-10-21 07:02:12 +00:00
Ahmed Mohamed Sameh
246a6a2f2f
Make sure that a BottomSheet doesn't crash in 0x0 environment (#172229)
This is my attempt to handle #6537 for the BottomSheet UI control.

---------

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
2025-10-20 22:41:13 +00:00
Ahmed Mohamed Sameh
92b1c878d4
Make sure that a NavigationDrawer doesn't crash in 0x0 environment (#176951)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the NavigationDrawer
widget.
2025-10-20 22:33:06 +00:00
Kostia Sokolovskyi
bd0e203215
Fix ink features painting in TabBar. (#177155)
Fixes https://github.com/flutter/flutter/issues/141269

## Description

- Fixes ink features painting outside of the `TabBar` bounds

| BEFORE | AFTER |
| - | - |
| <video alt="before"
src="https://github.com/user-attachments/assets/954ce655-b400-47f7-a641-5effe431cfa4"
/> | <video alt="after"
src="https://github.com/user-attachments/assets/283a64e9-4851-4f9a-98ad-a89d8fd4edb1"
/> |

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

<!-- 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
2025-10-20 20:42:53 +00:00