Robert Ancell
c5e809a998
Remove WindowingOwner.hasTopLevelWindows ( #178033 )
...
This function doesn't seem to serve any purpose.
Top level is not a term we are currently using in the multi window code.
If we want to track if we have open windows, this can be done in the
Flutter framework - it doesn't need to be done at the platform level.
2025-11-06 13:11:28 +00:00
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
Luke Memet
c652b53819
Fix ReorderableList items jumping when drag direction reverses mid-animation ( #173241 )
...
When rapidly dragging items in a ReorderableList before animations
complete, items would jump to their expected positions rather than
smoothly transitioning.
## Problem
<p align="center">
<img
src="https://github.com/user-attachments/assets/0efb250c-2960-4942-959f-59eccc20cefb "
alt="demo2" width="250">
</p>
The issue occurs when a reorder animation is interrupted by starting a
new drag operation. The interrupted animation would reset to the
starting position of the original animation rather than capturing the
current animated position, causing a visual jump.
## Solution
This PR fixes the issue by:
1. Storing the previous target offset before updating to a new target
2. When an animation is interrupted, calculating the actual current
position based on the animation's progress
3. Using this calculated position as the new starting point for the next
animation
<p align="center">
<img
src="https://github.com/user-attachments/assets/c24e4834-1c6b-41c1-8f44-17b4c79e0993 "
alt="demo2" width="250">
</p>
This PR is part of a series of `ReorderableList` enhancements I've
developed for [TimeFinder](https://timefinder.app ):
- #172740
- #172380
- #172739
- #172738
Fixes #173243
## Code Changes
```dart
// Before
_startOffset = offset;
// After
final double currentAnimValue = Curves.easeInOut.transform(_offsetAnimation\!.value);
final Offset currentPosition = Offset.lerp(_startOffset, previousTarget, currentAnimValue)\!;
_startOffset = currentPosition;
```
This ensures smooth transitions without visual jumping, making rapid
reordering gestures feel more responsive and natural.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [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 [migration
guide] as needed.
- [x] All existing and new tests are passing.
- [x] The analyzer (`flutter analyze --flutter-repo`) does not report
any problems on my PR.
- [x] I am willing to follow-up on review comments in a timely manner.
[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[migration guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#create-a-migration-guide
2025-11-05 00:20:33 +00:00
Hannah Jin
ed19f47bec
Add blockAccessibilityFocus flag ( #175551 )
...
Add a new flag for a11y focusable
- Accessibility focus, which is the focus used by screen readers like
TalkBack and VoiceOver, is different from input focus.
- Our current logic use some existing flags to decide if a node is
accessibilty focusable. like "if it's a slider / has a check state / has
keyboard focus/..., then it's a11y focusable"
ecbb115ae3/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java (L98)
- but we lack the ability to explicitly set a node to be unfocusable in
a11y!
- This flag can be used to explicitly set some semantics nodes to be
unfocusable in a11y mode. if it is false, we fall back to the logic "if
it's a slider / has a check state / has keyboard focus/..., then it's
a11y focusable"
future use case 1:
user can set live region to be not focusable, so when content changes,
it will still announce, but the content can't be focused by swiping.
future use case 2:
when pushing a new route like a dialog, setting the semantics nodes in
old pages to be un focusable.
## 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
2025-11-03 22:18:33 +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
Bui Dai Duong
7efa2aed3c
Colored box optimization ( #176028 ) ( #176073 )
...
This PR fixed visual bug when placing multiple `ColoredBox`s together.
(Fixes #176028 )
## 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: Victor Sanni <victorsanniay@gmail.com>
2025-11-02 18:59:19 +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
chunhtai
c914ec90f1
Adds cache extent type to two_dimentional_viewport ( #177411 )
...
<!--
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
-->
as title. this is needed if we want to change cache extent default to
use viewport % instead of pixels
## 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
2025-10-30 21:39:07 +00:00
Lewin Pauli
1ac41be367
Added computeDryBaseline implementation in RenderAligningShiftedBox ( #171250 )
...
<!--
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
-->
Implements computeDryBaseline method in RenderAligningShiftedBox to fix
layout failures when DropdownButtonFormField is used inside Wrap inside
AlertDialog. The method calculates baseline using dry layout methods and
accounts for child positioning within the parent's coordinate space.
Issue appeared when DropdownButtonFormField was used inside a Wrap
inside Alertdialog
Fixes
[flutter/flutter/issues/169214](https://github.com/flutter/flutter/issues/169214 )
## 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].
<!-- 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-30 00:06:20 +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
Alex Medinsh
37125ffd72
Add Navigator.popUntilWithResult ( #169341 )
...
<!--
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 adds a new `Navigator.popUntilWithResult` method that allows to
pass a value to the last `pop` call.
Fixes https://github.com/flutter/flutter/issues/30112
## 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].
<!-- 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-29 06:11:35 +00:00
Bruno Leroux
497c61ed56
Fix EditableText _justResumed is not accurate ( #177658 )
...
## Description
This PR tweaks the selection logic added in
https://github.com/flutter/flutter/pull/157399 .
Before this PR (and since
https://github.com/flutter/flutter/pull/157399 ) when the app resumed
while a TextField was selected the selection of the TextField is
maintained. This is the right behavior for the currently focused
TextField. But when there are several TextFields, after the app resumed
and the user move the focus to a another TextField, the behavior should
be to select all the content of the newly focused TextField. To achieve
this the `_justResumed`flag added in
https://github.com/flutter/flutter/pull/157399 should be reset as soon
as the focus move as it is needed only for the current focused TextField
to restore its selection just after the app resumed.
## Related Issue
Fixes [Pressing tab does select all content when app is resumed for
TextFields which were not
focused](https://github.com/flutter/flutter/issues/177650 )
## Tests
- Adds 1 test
2025-10-28 22:11:05 +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
Victor Sanni
df3867ed94
Correct editable text and placeholder position in baseline aligned stack ( #177342 )
...
This PR makes CupertinoTextField's placeholder and editable text
position respect `CupertinoTextField.textAlignVertical`.
<details open>
<summary>Image comparison</summary>
| | Before | After |
| --- | --- | --- |
| top | <img width="436" height="327" alt="top b4"
src="https://github.com/user-attachments/assets/39606c72-fb1f-4619-bfb2-ccaeaf502324 "
/> | <img width="436" height="327" alt="top"
src="https://github.com/user-attachments/assets/faea26fc-c934-4660-bbee-e62effa44599 "
/> |
| center | <img width="436" height="327" alt="top b4"
src="https://github.com/user-attachments/assets/39606c72-fb1f-4619-bfb2-ccaeaf502324 "
/> | <img width="436" height="327" alt="center"
src="https://github.com/user-attachments/assets/2ee7004a-6f70-4af2-b33b-76293c8deac1 "
/> |
| bottom | <img width="436" height="327" alt="top b4"
src="https://github.com/user-attachments/assets/39606c72-fb1f-4619-bfb2-ccaeaf502324 "
/> | <img width="436" height="327" alt="bottom"
src="https://github.com/user-attachments/assets/69ba89fb-9f1c-456e-9889-216eb31d66b9 "
/> |
</details>
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(const TextFieldApp());
class TextFieldApp extends StatelessWidget {
const TextFieldApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(home: HomePage());
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
TextEditingController commentController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey,
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: CupertinoTextField(
style: const TextStyle(fontSize: 40),
placeholderStyle: const TextStyle(
fontSize: 80,
color: CupertinoColors.inactiveGray,
),
placeholder: 'Enter text',
textAlignVertical: TextAlignVertical.bottom,
),
),
),
),
);
}
}
```
</details>
Fixes [CupertinoTextField text not vertically centered when fontSize
differs between style and
placeholderStyle.](https://github.com/flutter/flutter/issues/176817 )
2025-10-27 22:53:57 +00:00
Jason Simmons
e090117bde
Set the font weight variation axis based on the text style's FontWeight ( #175771 )
...
This makes it possible for applications to set a FontWeight and get the
expected result for both variable fonts and fonts that provide separate
assets for each weight.
See https://github.com/flutter/flutter/issues/148026
2025-10-27 20:10:17 +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