4189 Commits

Author SHA1 Message Date
Kate Lovett
a04fb324be
Bump Dart to 3.8 and reformat (#171703)
Bumps the Dart version to 3.8 across the repo (excluding
engine/src/flutter/third_party) and applies formatting updates from Dart
3.8.

## 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 `///`).
- [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-07-07 17:58:32 +00:00
Valentin Vignal
bf3e8566eb
Add backgroundColor to RadioThemeData (#171326)
Part of https://github.com/flutter/flutter/issues/168787

Follow-up of https://github.com/flutter/flutter/pull/171204

## 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-07-02 18:38:08 +00:00
Valentin Vignal
10298edaab
Add innerRadius to Radio (#171331)
Part of https://github.com/flutter/flutter/issues/168787

Add the ability to customize the inner radius of the `Radio` button


https://github.com/user-attachments/assets/234fffda-f42f-463f-bc97-284c160c86ef

<img width="274" alt="Screenshot 2025-06-28 at 6 23 11 PM"
src="https://github.com/user-attachments/assets/45a0525d-ff94-4fb3-85d3-0d2353b39e98"
/>

## 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-07-02 18:38:06 +00:00
Pranav
a69ba5da50
fix: time selector separator in timepicker is not centered vertically (#168441)
PR Description
This PR addresses an issue in the Flutter time picker where the
separator between the hour and minute selectors (:) was not centered
vertically. The change ensures that the separator is now vertically
centered, improving the overall UI alignment and consistency.

Previously, the separator used only the TextAlign.center property, which
did not fully address the vertical alignment issue. The updated code
wraps the separator text in a Center widget to ensure proper centering
both horizontally and vertically.

Before:

The separator (:) was horizontally centered but not aligned vertically.
After:

The separator is now both horizontally and vertically centered within
the time picker.


![image-20241023-041530](https://github.com/user-attachments/assets/8401264a-a751-47b4-b634-5742ba4fabcd)
![Screenshot 2024-10-23 at 12 33
05](https://github.com/user-attachments/assets/ab95abd9-8de8-4f7d-9114-d96073d8f887)

Issues Fixed
This PR fixes issue https://github.com/flutter/flutter/pull/157402
(Vertical alignment issue in the time picker separator).

---------

Co-authored-by: Mitchell Goodwin <58190796+MitchellGoodwin@users.noreply.github.com>
Co-authored-by: Chris Bracken <chris@bracken.jp>
2025-07-02 16:31:59 +00:00
Huy
c2aa5180f0
Fix DropdownMenu does not apply opacity to the selected value when disabled (#170336)
Fix https://github.com/flutter/flutter/issues/169942

### Description

The bug is about the
[effectiveTextStyle](b086fe7b79/packages/flutter/lib/src/material/dropdown_menu.dart (L979))
being applied to the inner
[TextField](b086fe7b79/packages/flutter/lib/src/material/dropdown_menu.dart (L1049))
inside DropdownMenu fails to reflect the disabled style based on the
[enabled
property](b086fe7b79/packages/flutter/lib/src/material/dropdown_menu.dart (L209)).
The fix for this is simply to check the `enabled` property and override
the TextField's TextStyle.

### Demo of the fix

| before | after |
| --------------- | --------------- |
<video
src="https://github.com/user-attachments/assets/0c56577b-301a-4369-bb1c-280643521cab"/>
| <video
src="https://github.com/user-attachments/assets/7e806fc7-4b90-49e5-b91b-8779454c8e60"/>

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

---------

Signed-off-by: huycozy <huy@nevercode.io>
2025-07-02 01:10:33 +00:00
Bruno Leroux
a7bfe6e498
Add tests for some local InputDecorationTheme properties (#171435)
## Description

This PR adds tests for `InputDecorationThemeData.floatingLabelBehavior`,
`InputDecorationThemeData.floatingLabelAlignment`, and
`InputDecorationThemeData.contentPadding`.

## Related Issue

Related to https://github.com/flutter/flutter/pull/168981

## Tests

Adds 3 tests, moves one.
2025-07-01 23:48:25 +00:00
Ramon Farizel
319bd1109c
Add WidgetStatesController to ListTile (#168878)
Add WidgetStatesController to ListTile

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

## 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-06-30 22:35:17 +00:00
Valentin Vignal
b2056cb629
Add radioBackgroundColor to RadioListTile (#171204)
Part of https://github.com/flutter/flutter/issues/168787

Continuation of https://github.com/flutter/flutter/pull/169415

## 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-06-28 03:47:20 +00:00
Lucas SAUDON
8aa701bf0c
fix: Add focusNode and textEditingController in Autocomplete (#170936)
<!--
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
-->

*Allows you to keep the selected value when the autocomplete is in a
listview and you scroll through it.*

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

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
2025-06-27 20:38:07 +00:00
Juergen Werner
5b6b62183f
NavigationRail: optionally scrollable and more configurable (#169421)
<!--
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 is modified and extended version of the merged and reverted PR
#137415. It was reverted, because it broke a the sample app "Material 3
demo". This PR circumvents the breaking of existing code, by making the
changes optional via constructor parameters. Default values for the
parameters are functionally equivalent to the state before this change.
The new key parameter for this is `scrollable`.

Additionally this change includes the parameters `leadingAtTop: true`
and `trailingAtBottom: false`.

Fixes #89167


## 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-06-27 18:19:06 +00:00
Valentin Vignal
f83d842347
Add side to Radio (#171217)
Part of https://github.com/flutter/flutter/issues/168787

This PR adds `side` parameter to `Radio` to be able to control its color
and width.

This allows me to implement something like:


https://github.com/user-attachments/assets/8065df9b-4cea-48b6-ba34-21379a831a2e

In order to make it non breaking, when absent, it uses the `fillColor`


## 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-06-27 17:48:00 +00:00
Ahmed Elsayed
05add65f63
Reland [#166645] Fix DropdownButtonFormField focusing when replacing FocusNode (#170761)
This is a reland of #166645

fixes #166642

**The newly added tests verify the following behaviors:**

1. DropdownButtonFormField can be focused if it was unfocused and we
replaced FocusNode.
2. DropdownButtonFormField can be unfocused if it was focused and we
replaced FocusNode.

## 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-06-27 07:12:22 +00:00
Justin McCandless
142cce676e
Avoid using a Key whose only purpose is to be looked up in a test (#170952)
This PR investigates moving away from the few places where we rely on
Keys to instead solely look up a widget in a test. Reasons:

 * No extra stuff in users' apps that they don't need for production.
* Avoid collisions between Keys in users' apps that might have the same
identifier string.

I'm definitely still up for discussion on whether or not this is a good
idea!

Written in response to the discussion on
https://github.com/flutter/flutter/pull/170761#discussion_r2159760635.
2025-06-26 23:18:05 +00:00
Simone Stasi
777bfea286
fix PopupMenuButton unmounted exception when updating position (#166412)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

This PR fixes an exception thrown when trying to update an unmounted
PopupMenuButton's position, which can happen when a layout change is
triggered during PopupMenuButton's pop animation (see issue's attached
video).
A workaround is to set `popUpAnimationStyle:
AnimationStyle.noAnimation`.
This PR fixes it by returning the last known position if the button is
unmounted.

Exception thrown:` FlutterError (This widget has been unmounted, so the
State no longer has a context (and should be considered defunct).
Consider canceling any active work during "dispose" or using the
"mounted" getter to determine if the State is still active.)`

Code that causes the exception: `final PopupMenuThemeData popupMenuTheme
= PopupMenuTheme.of(context);`

Fixes #163477 

Tested both on stable (3.29.2) and master (a0b1b325341)

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

---------

Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
2025-06-26 21:04:05 +00:00
Bruno Leroux
5bb48258cc
Add missing M3 tests for InputDecoration.floatingLabelAlignment (#170903)
## Description

This PR adds missing M3 tests for
InputDecoration.floatingLabelAlignment.

## Related Issue

Will help to complete https://github.com/flutter/flutter/pull/168981

## Tests

Adds 8 tests (based on existing M2 tests).
2025-06-26 19:03:41 +00:00
Lucas SAUDON
ab0087c256
feat: Add hintLocales in TextFormField (#170938)
Add hintLocales in TextFormField

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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-06-26 16:38:24 +00:00
Alex Talebi
e6ecca06dd
Fix text selection toolbar alignment for RTL languages (#169854)
<!--
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
-->

**Fix text selection toolbar alignment for RTL (right-to-left)
languages**

This PR updates the Material text selection toolbar to properly support
right-to-left (RTL) layouts. Previously, the toolbar and its buttons did
not align or order correctly when using RTL text direction, leading to a
broken or confusing user experience for RTL languages.

**Summary of changes:**
- Refactored layout logic in `text_selection_toolbar.dart` to handle RTL
and LTR directions for both horizontal and overflow (vertical)
arrangements.
- Updated padding logic in `text_selection_toolbar_text_button.dart` to
use `EdgeInsetsDirectional`, ensuring correct padding for both text
directions.
- Added new widget tests to verify that:
  - Toolbar items are ordered right-to-left in RTL contexts.
- The overflow menu behaves correctly in RTL, showing items in the
correct order and position.

**Before:**  
- Toolbar items and overflow menus did not respect RTL layout, resulting
in misaligned or reversed button order.
- Padding was inconsistent in RTL.
<details>
<summary>Before Screenshots</summary>

| LTR Not Expanded | LTR Expanded | RTL Not Expanded | RTL Expanded |
|---|---|---|---|
| ![before_ltr_non_expanded
jpg](https://github.com/user-attachments/assets/bccf719e-c95a-46b1-b924-d2fb229e4ada)
| ![before_ltr_expanded
jpg](https://github.com/user-attachments/assets/a947690a-62fb-4f41-863c-d3822294bb66)
|
![before_rtl_non_expanded](https://github.com/user-attachments/assets/1e3440ee-d80c-4554-aeda-7632f2b166ca)
|
![before_rtl_expanded](https://github.com/user-attachments/assets/364a3b2b-d068-4488-afbd-61224e74c30a)
|

</details>


**After:**  
- Toolbar items and overflow menus are correctly ordered and aligned for
RTL.
- Button padding is now directionally correct.

<details>
<summary>After Screenshots</summary>

| LTR Not Expanded | LTR Expanded | RTL Not Expanded | RTL Expanded |
|---|---|---|---|
|
![after_ltr_non_expanded](https://github.com/user-attachments/assets/b63bf625-0d37-4304-9ba5-af017c197b15)
|
![after_ltr_expanded](https://github.com/user-attachments/assets/6a95c9b7-e343-4e7e-93ae-f18de6d38a2e)
|
![after_rtl_not_expanded](https://github.com/user-attachments/assets/8a93b08b-fcf2-45a9-8f5a-390133c0aec4)
|
![after_rtl_expanded](https://github.com/user-attachments/assets/5cbdffd4-3943-44cc-98d9-fa470e11b942)
|

</details>

This improves the usability and accessibility of text selection controls
for users of RTL languages.


Fixes #59306 

---

## 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-06-25 21:00:49 +00:00
Valentin Vignal
a5a3ab3f92
Fix Radio's painters (#170321)
While working on https://github.com/flutter/flutter/issues/168787 as a
follow-up of https://github.com/flutter/flutter/pull/169415, I noticed
that the tests introduced in
https://github.com/flutter/flutter/pull/169415 were incorrect. However,
because of the way the `Radio` implements `paint` and reuses 1 painter,
it was not possible to properly assert the paints in the test.

This PR fixes it

## 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-06-25 19:25:50 +00:00
ash2moon
c9537a5509
Add back "Use live region in error text input decorator for Android #165531" (#168992)
Partly of https://github.com/flutter/flutter/issues/165510

⤴️ Parent PR: https://github.com/flutter/flutter/pull/169685 ( Merged)
⤴️ Parent PR (refactor): https://github.com/flutter/flutter/pull/170618
( Merged)

Re-lands https://github.com/flutter/flutter/pull/165531
The PR was originally reverted due to an issue with an internal Google
test. I added a new test case under `input_decorator_test.dart` which
does something similar to prevent the regression. All other code is the
same as https://github.com/flutter/flutter/pull/165531.

The easiest way to review this would probably be to just check the [diff
after the first
commit](cb5647c393)
to see the changes I made. To check if the reland commit is the same, it
might be best to just [compare solely that
commit](9bd8d5689b)
against the [original
PR](https://github.com/flutter/flutter/pull/165531/files).

## 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-06-25 19:12:23 +00:00
jcheng
c103588ed5
feat: Add constraints to the AlertDialog and SimpleDialog (#169327)
close: https://github.com/flutter/flutter/issues/169326

## 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-06-25 17:26:10 +00:00
Bruno Leroux
e9d8e93e53
Add missing M3 tests for InputDecoration.isDense (#171058)
## Description

This PR adds missing M3 tests for `InputDecoration.isDense`.

## Related Issue

Related to https://github.com/flutter/flutter/pull/168981

## Tests

Adds 4 tests.
2025-06-25 08:07:20 +00:00
zhengzeqin
dd89ae96c4
When maintainHintSize is false, hint is centered and aligned, it is different from the original one (#168654)
This PR changes the Hint uses topLeft alignment when maintainHintSize is
false
> code
```dart
buildTextField() {
  return const Center(
    child: TextField(
      decoration: InputDecoration(
        hintText: 'hint',
        maintainHintSize: false,
      ),
    ),
  );
}
```

Before:

<img width="416" alt="b"
src="https://github.com/user-attachments/assets/fe58c2d0-4d37-4bca-aabc-0f7d4785fb2a"
/>

After:
<img width="415" alt="a"
src="https://github.com/user-attachments/assets/096fd83a-9d8f-4cb7-be1d-c3075acbfdc0"
/>



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

---------

Co-authored-by: 郑泽钦 <zhengzeqin@addcn.com>
2025-06-24 08:04:12 +00:00
Bruno Leroux
0adb0337e0
Deprecate DropdownButtonFormField "value" parameter in favor of "initialValue" (#170805)
## Description

This PR renames the DropdownButtonFormField constuctor parameter 'value'
to 'initialValue'.
See
https://github.com/flutter/flutter/pull/170050#issuecomment-2965486000
and
https://github.com/flutter/flutter/pull/170050#issuecomment-2971920009
for some context.

## Related Issue

Fixes [DropdownButtonFormField retains selected value even after setting
value to null](https://github.com/flutter/flutter/issues/169983#top)

## Tests

Adds 2 tests (one to validate the deprecated parameter can still be
used, one for the dart fix).
Updates many (renaming the confusing parameter).
2025-06-24 07:08:21 +00:00
Kevin Moore
8aef6e2775
Flutter test cleanup (#170891)
Mostly related to error tracking.
2025-06-24 00:10:55 +00:00
Bruno Leroux
99d909aed0
Reland: Fix InputDecoration.floatingLabelBehavior is not inherited (#170995)
## Description

Reland https://github.com/flutter/flutter/pull/170905 which was reverted
in https://github.com/flutter/flutter/pull/170994

The change from https://github.com/flutter/flutter/pull/170905 had to be
adjusted with a change which landed just before
(https://github.com/flutter/flutter/pull/168981).
2025-06-23 09:03:21 +00:00
auto-submit[bot]
73daff152f
Reverts "Fix InputDecoration.floatingLabelBehavior is not inherited (#170905)" (#170994)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#170905
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: goderbauer
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Analyzer failure: `The argument type
'InputDecorationTheme' can't be assigned to the parameter type
'InputDecorationThemeData?'. •
packages/flutter/test/material/input_decorator_test.dart:2959:33 •
argument_type_not_assignable`
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bleroux
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
## Description

This PR fixes `InputDecoration.floatingLabelBehavior` logic to query
ambient InputDecorationTheme.floatingLabelBehavior, previously it was
ignored.

## Related Issue

Fixes [InputDecorationTheme and IconTheme isn't fully
inherited](https://github.com/flutter/flutter/issues/71813)
Will help to complete https://github.com/flutter/flutter/pull/168981

## Tests

Adds 1 test
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-06-23 07:24:42 +00:00
Bruno Leroux
6ebb7cf46b
Fix InputDecoration.floatingLabelBehavior is not inherited (#170905)
## Description

This PR fixes `InputDecoration.floatingLabelBehavior` logic to query
ambient InputDecorationTheme.floatingLabelBehavior, previously it was
ignored.

## Related Issue

Fixes [InputDecorationTheme and IconTheme isn't fully
inherited](https://github.com/flutter/flutter/issues/71813)
Will help to complete https://github.com/flutter/flutter/pull/168981

## Tests

Adds 1 test
2025-06-23 06:09:28 +00:00
Bruno Leroux
de3f804590
Normalize input decoration theme (#168981)
This PR is to make `InputDecorationTheme` conform to Flutter Material's
conventions for component themes:

- Added a `InputDecorationThemeData` class which defines overrides for
the defaults for `InputDecorator` properties.
- Added `InputDecorationTheme` constructor parameters:
`InputDecorationThemeData? data` and `Widget? child`. This is now the
preferred way to configure a `InputDecorationTheme`:

```dart
InputDecorationTheme(
	data: InputDecorationThemeData(
	    filled: true,
	    fillColor: Colors.amber,
	    ...
	  ),
  	child: const TextField()
)
```
These two properties are made nullable to not break existing apps which
has customized `ThemeData.inputDecorationTheme`.

- Update `InputDecorationTheme` to be an `InheritedTheme` subclass.
- Changed the type of component theme defaults from
`InputDecorationTheme` to `InputDecorationThemeData`.
- Changed the `InputDecorationTheme bottomAppBarTheme` property to
`Object? bottomAppBarTheme` in `ThemeData` and `ThemeData.copyWith()`
(Object? is used for the moment to minimize Google tests failure. A
follow-up PR will replace `Object?` with `InputDecorationThemeData`.
- Addresses the "theme normalization" sub-project within #91772.

A migration guide will be created on website repo.
2025-06-21 23:02:13 +00:00
Huy
41acbd244d
Normalize AppBarTheme (#169130)
This PR is to make `AppBarTheme` conform to Flutter Material's
conventions for component themes:

- Added a `AppBarThemeData` class which defines overrides for the
defaults for `AppBar` properties.
- Added AppBarTheme constructor parameters: `AppBarThemeData? data` and
`Widget? child`. This is now the preferred way to configure a
`AppBarTheme`:

```dart
AppBarTheme(
      data: AppBarThemeData(),
      child: Scaffold(
        appBar: AppBar(
          title: xxx,
          leading: xxx,
          actions: xxx,
     ),
),
```
These two properties are made nullable to not break existing apps which
has customized `ThemeData.appBarTheme`.

- Update `AppBarTheme` to be an `InheritedWidget` subclass.
- Changed the type of component theme defaults from `AppBarTheme` to
`AppBarThemeData`.
- Add new tests for `AppBarThemeData` and update the existing
`AppBarTheme` tests.
- This also temporarily changes `AppBarThemeData` to `Object?` in
`ThemeData` class, to bypass g3 tests, following
https://github.com/flutter/flutter/pull/168586#discussion_r2082606584.
- Addresses the "theme normalization" sub-project within
https://github.com/flutter/flutter/issues/91772.

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

---------

Signed-off-by: huycozy <huy@nevercode.io>
Co-authored-by: Qun Cheng <chengqunq@gmail.com>
2025-06-20 23:07:37 +00:00
jcheng
061dd46f15
feat: Add radius to DividerThemeData. (#169739)
close: https://github.com/flutter/flutter/issues/169738

## 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.
2025-06-18 05:29:09 +00:00
Kevin Moore
55f5aed6e4
Prefer .of over .from (#170750)
Often faster in cases where the types match

There SHOULD be a lint: https://github.com/dart-lang/sdk/issues/58359
2025-06-17 18:37:11 +00:00
Renzo Olivares
fe6c9690bf
Update default selectionHeightStyle and selectionWidthStyle for EditableText (#167762)
This change updates the default `selectionHeightStyle` and
`selectionWidthStyle` for `EditableText` to more closely match the
behavior on native platforms.

```dart
/// The default value for [selectionHeightStyle].
///
/// On web platforms, this defaults to [ui.BoxHeightStyle.max].
///
/// On native platforms, this defaults to [ui.BoxHeightStyle.includeLineSpacingMiddle] for all
/// platforms.
static ui.BoxHeightStyle get defaultSelectionHeightStyle {
  if (kIsWeb) {
    return ui.BoxHeightStyle.max;
  }
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.iOS:
    case TargetPlatform.linux:
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
      return ui.BoxHeightStyle.includeLineSpacingMiddle;
  }
}

/// The default value for [selectionWidthStyle].
///
/// On web platforms, this defaults to [ui.BoxWidthStyle.max] for Apple platforms and
/// [ui.BoxWidthStyle.tight] for all others.
///
/// On non-web platforms, this defaults to [ui.BoxWidthStyle.max] for all
/// platforms.
static ui.BoxWidthStyle get defaultSelectionWidthStyle {
  if (kIsWeb) {
    if (defaultTargetPlatform == TargetPlatform.iOS || WebBrowserDetection.browserIsSafari) {
      return ui.BoxWidthStyle.max;
    }
    return ui.BoxWidthStyle.tight;
  }
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.iOS:
    case TargetPlatform.linux:
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
      return ui.BoxWidthStyle.max;
  }
}
```

## Native Selection Style Behavior

### Android Native Behavior

| Component Type | UI Framework / Component | Image |
|---|---|---|
| **Static Text** | Android TextView | <img height="400"
alt="native_android_static_textview"
src="https://github.com/user-attachments/assets/34da885c-c3d8-4ecc-baf5-65cd32850aa7"
/> |
| **Static Text** | Jetpack Compose Text | <img height="400"
alt="native_android_static_compose"
src="https://github.com/user-attachments/assets/ef916e8d-3627-4394-b5a1-aa59989ba826"
/> |
| **Static Text** | Chrome (Web) "p element" | <img height="400"
alt="android_chrome_web"
src="https://github.com/user-attachments/assets/b6537871-5d07-470b-bdee-ae0d222b2404"
/> |
| **Text Field** | Android EditText | <img height="400"
alt="native_android_textfield_edittext"
src="https://github.com/user-attachments/assets/ef91c6c3-eed0-4cf5-8b6f-182ecf8ce60b"
/> |
| **Text Field** | Jetpack Compose TextField | <img height="400"
alt="native_android_textfield_compose"
src="https://github.com/user-attachments/assets/891c28ba-66f7-4923-a1d3-839cad3b039c"
/> |

### iOS Native Behavior

| Component Type | UI Framework / Component | Image |
|---|---|---|
| **Text Field** | Native SwiftUI TextEditor | <img height="400"
alt="native_ios_texteditor"
src="https://github.com/user-attachments/assets/b99adb30-8cb3-454e-aa56-41f3cfadeeed"
/> |
| **Text Field** | Native SwiftUI TextField | <img height="400"
alt="native_ios_textfield"
src="https://github.com/user-attachments/assets/0544419b-b9a7-4641-930b-9a123f9a7720"
/> |
| **Static Text** | Safari (Web) "p element" | <img height="400"
alt="mobile_safari_web"
src="https://github.com/user-attachments/assets/6934ed80-4712-4000-bff0-4d5d2833abbe"
/> |

### macOS Native Behavior

| Component Type | UI Framework / Component | Image |
|---|---|---|
| **Static Text** | Native SwiftUI Text | <img height="400"
alt="native_macos_static_text"
src="https://github.com/user-attachments/assets/becf7690-878e-4cf1-b9d7-49725d58fd42"
/> |
| **Static Text** | Chrome (Web) "p element" | <img height="400"
alt="chrome_web"
src="https://github.com/user-attachments/assets/bf38e1c0-7bd6-42b7-8230-71b8365ac1d7"
/> |
| **Static Text** | Firefox (Web) "p element" | <img height="400"
alt="firefox_web"
src="https://github.com/user-attachments/assets/54817628-690b-4243-8bb0-0d94afaf5013"
/> |
| **Static Text** | Safari (Web) "p element" | <img height="400"
alt="safari_web"
src="https://github.com/user-attachments/assets/08ae8a6e-8ea5-4cc5-84f8-49c5f759e910"
/> |
| **Text Field** | Native SwiftUI TextEditor | <img height="400"
alt="native_macos_texteditor"
src="https://github.com/user-attachments/assets/43995c72-acf5-4ef0-99d7-faa3940b16e7"
/> |
| **Text Field** | Native SwiftUI TextField | <img
alt="native_macos_textfield"
src="https://github.com/user-attachments/assets/d5606b23-dff0-47da-a1e8-b1c71047c426"
/> |

## Flutter Selection Style Behavior

### Flutter Before Behavior

This was the behavior on all platforms before this change.

| Component Type | Behavior | Image |
|---|---|---|
| **Text Field** | Flutter TextField | <img height="400"
alt="flutter_before_text_field"
src="https://github.com/user-attachments/assets/014bfc9d-0bbe-49ee-9230-9da80addc675"
/> |
| **Static Text** | Flutter SelectableText | <img height="400"
alt="flutter_before_selectabletext"
src="https://github.com/user-attachments/assets/251956c6-4d7d-4d3e-802a-33718f30cbf3"
/> |

### Flutter Chrome After Behavior

This is the behavior on all chrome web after this change.

| Component Type | Behavior | Image |
|---|---|---|
| **Static Text** | Flutter SelectableText in Chrome | <img height="400"
alt="flutter_after_chrome_selectabletext"
src="https://github.com/user-attachments/assets/167ee998-c9c4-4367-ab77-149514fb2b15"
/> |
| **Text Field** | Flutter TextField in Chrome | <img height="400"
alt="flutter_after_chrome_textfield"
src="https://github.com/user-attachments/assets/76b123df-c818-4304-afb8-7034506e2031"
/> |

### Flutter Safari After Behavior

This is the behavior on Safari after this change. (all iOS browsers, and
Safari on macOS).

| Component Type | Behavior | Image |
|---|---|---|
| **Text Field** | Flutter TextField in Safari | <img height="400"
alt="flutter_after_safari_textfield"
src="https://github.com/user-attachments/assets/c37e80cf-d89a-43aa-baff-f32e94f39b56"
/> |
| **Static Text** | Flutter SelectableText in Safari | <img height="400"
alt="flutter_after_safari_selectabletext"
src="https://github.com/user-attachments/assets/c1a11d76-afb9-4265-af54-e20e183839e1"
/> |

### Flutter Native After Behavior

This is the behavior on native platforms after this change.

| Component Type | Behavior | Image |
|---|---|---|
| **Static Text** | Flutter SelectableText on Native platforms | <img
height="400" alt="flutter_after_native_selectabletext"
src="https://github.com/user-attachments/assets/5506eb4c-13ed-4c04-b680-9d097f20b159"
/> |
| **Text Field** | Flutter TextField on Native platforms | <img
height="400" alt="flutter_after_native_textfield"
src="https://github.com/user-attachments/assets/e65bba53-34d3-480c-9293-d597b587fe70"
/> |

Fixes #68675

## 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>
2025-06-16 22:30:31 +00:00
Alex Medinsh
fc7c97c146
Add DropdownButtonFormField value param test (#170518)
This PR adds a new test that verifies that the value param is only used
on initial build and when resetting the field.

Test for
https://github.com/flutter/flutter/pull/170050#issuecomment-2965486000

## 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: Bruno Leroux <bruno.leroux@gmail.com>
2025-06-16 16:18:05 +00:00
yim
972c181212
Allow the Slider to always show the value indicator. (#162223)
Fixes: #34704

Modified enum `ShowValueIndicator`
before:
```dart
enum ShowValueIndicator {
  onlyForDiscrete,
  onlyForContinuous,
  always,
  never,
}
```
after:
```dart
enum ShowValueIndicator {
  onlyForDiscrete,
  onlyForContinuous,
  @Deprecated(
    'Use ShowValueIndicator.onDrag. '
    'This feature was deprecated after v3.28.0-1.0.pre.',
  )
  always,
  onDrag,
  alwaysVisible,
  never,
}
```
To maintain previous behavior, `ShowValueIndicator.onlyForDiscrete` and
`ShowValueIndicator.onlyForContinuous` are still retained.

The behavior of `ShowValueIndicator.always` remains consistent with the
previous implementation, but it is marked as deprecated and should be
replaced with `ShowValueIndicator.onDrag`. A new
`ShowValueIndicator.alwaysVisible` has been added to show the value
indicator even when not dragging.

Additionally, the value indicator is now rendered by `OverlayPortal`.


*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## 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-06-11 23:25:14 +00:00
Ahmed R.
4e0c01066e
Make DropdownMenu TextField reactive to label changes (#162062)
## Description

The current behavior of Flutter regarding `DropdownMenu` text field is
very basic: `DropdownMenu` updates the text field once a selection has
been made with its coordinating `label`, and nothing more.

If the selection's `label` changes, the text field will still show the
old value, although the menu buttons have been updated.

This not only results in the need to write a lot of boilerplate code to
match the label to the current selection, but it's also
counterintuitive. The `DropdownMenu` should handle rematching by itself.

Issue #155660, touched on this, and a solution was introduced in
#155757. It was later reverted due to it restricting some use cases.
That issue & solution, however, only address `initialSelection`. If
another selection was made and its corresponding `label` was changed,
the text field would still show the old value, bringing us back to
square one.

This PR should not conflict with any previous behavior of
`DropdownMenu`: any new value provided by `initialSelection` or via
controller would not be overwritten by rematching. However, entries with
the same value will be mapped to a single label (the first matched
entry's label).

## Related Issues

- Fixes #155660.

## Tests

Added 3 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.
2025-06-11 23:08:37 +00:00
auto-submit[bot]
ee089d09b2
Reverts "Fix DropdownButtonFormField focusing when replacing FocusNode (#166645)" (#170477)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#166645
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jonahwilliams
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: multiple test failures w/ dropdown buttons -
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20framework_tests_libraries/22946/overview
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: AhmedLSayed9
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {bleroux, justinmc}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
fixes #166642

**The newly added tests verify the following behaviors:**

1. DropdownButtonFormField can be focused if it was unfocused and we
replaced FocusNode.
2. DropdownButtonFormField can be unfocused if it was focused and we
replaced FocusNode.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-06-11 20:48:48 +00:00
Juergen Werner
a4a2ef6d1e
Fix remaining iconbuttontheme overrides in listtile (#169029)
<!--
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
-->

Fix remaining outstanding IconButtonTheme overrides: overlayColor and
mouseCursor.

Issue: #167727


## 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-06-11 18:50:54 +00:00
Ahmed Elsayed
064f6d1509
Fix DropdownButtonFormField focusing when replacing FocusNode (#166645)
fixes #166642

**The newly added tests verify the following behaviors:**

1. DropdownButtonFormField can be focused if it was unfocused and we
replaced FocusNode.
2. DropdownButtonFormField can be unfocused if it was focused and we
replaced FocusNode.

## 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>
2025-06-11 18:50:54 +00:00
Bruno Leroux
d6b2a95215
Fix date picker calendar tap targets (portrait mode) (#169163)
## Description

This PR fixes the touch target (and Semantic bounds) for day buttons
shown in the date picker calendar mode.
To do so it changes the dialog size and buttons padding to conform to
the M3 spec, see
https://m3.material.io/components/date-pickers/specs#2d53890e-a08f-4c63-a0d9-abd9e95b4245

### Before


![image](https://github.com/user-attachments/assets/22f906b9-bd95-4996-852e-bc2df4247364)

### After


![image](https://github.com/user-attachments/assets/83fd37e2-2cd1-454d-a13d-f2dcc3220e3b)

## Related Issue

Fixes [DateTimePicker date buttons fail touch target size accessibility
checks](https://github.com/flutter/flutter/issues/158325)

## Tests

Adds 1 test.

## Implementation choice

This PR targets only M3 and portrait mode:
- M3 because M2 dialog picker was not designed to be accessible (day
buttons are 40 pixels).
- Portrait mode only, because there are no specification for the
landscape mode and existing implementations (Google Calendar, Compose)
vary. I will open a separate issue to discuss a possible solution for
landscape mode.
2025-06-11 16:00:50 +00:00
Valentin Vignal
b086fe7b79
Add backgroundColor to Radio (#169415)
Part of https://github.com/flutter/flutter/issues/168787

Adds `backgroundColor` property to `Radio`

This code sample is now possible:

<details>

<summary>Example</summary>

```dart
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

void main() {
  runApp(const MyWidget());
}

class MyWidget extends StatefulWidget {
  const MyWidget({super.key});

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool? _value;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Column(
          children: <Widget>[
            Radio<bool>(
              value: true,
              groupValue: _value,
              toggleable: true,
              onChanged: (bool? value) {
                setState(() {
                  // Toggle the value when the radio button is pressed
                  _value = value;
                });
              },
              activeColor: Colors.red,
              fillColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
                if (states.contains(MaterialState.selected)) {
                  return Colors.green;
                }
                return Colors.blue; // Default color when not selected
              }),
              backgroundColor: MaterialStateProperty.resolveWith<Color>((
                Set<MaterialState> states,
              ) {
                if (states.contains(MaterialState.selected)) {
                  return Colors.orange.withOpacity(0.5);
                }
                return Colors.purple.withOpacity(0.5); // Default background color when not selected
              }),
            ),
            Radio<bool>(
              value: false,
              groupValue: _value,
              toggleable: true,
              onChanged: (bool? value) {
                setState(() {
                  // Toggle the value when the radio button is pressed
                  _value = value;
                });
              },
            ),
          ],
        ),
      ),
    );
  }
}
```
</details>


https://github.com/user-attachments/assets/d1a9d422-89f6-4b28-bb6c-add6ead13a21




## 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-06-10 01:38:08 +00:00
chunhtai
60cbfb76a2
Fixes inputDecoration sibling explicit child not included in semantic… (#170079)
…s tree

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

fixes https://github.com/flutter/flutter/issues/169499

## 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
2025-06-09 20:10:46 +00:00
chunhtai
d0058ec361
Adds radio group widget r2 (#168161)
<!--
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
-->

previous https://github.com/flutter/flutter/pull/167363

I have to factor out abstract class for RadioGroupRegistry and
RadioClient which are subclassed by RadioGroupState and RawRadio
respectively.

I have to do this because the RadioListTile that has 2 focusnode one for
listTile and one for the radio it builds. The issue is that RadioGroup's
keyboard shortcut has to tightly couples with the focus node of each
radio, but the radioListtile has to mute the radio's focusnode so it can
act as one control under keyboard shortcut

d582b35809/packages/flutter/lib/src/material/radio_list_tile.dart (L484)

Therefore i abstract the out the logic of RadioGroup so that another
widget can participate by implementing the interface.

fixes https://github.com/flutter/flutter/issues/113562

migration guide: https://github.com/flutter/website/pull/12080/files

## 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
2025-06-02 19:03:51 +00:00
Koji Wakamiya
d064c95c10
[Web][Engine] Update MediaQuery in response to semanticsEnabled (#166836)
fix https://github.com/flutter/flutter/issues/134980

Calling
`EnginePlatformDispatcher.instance.invokeOnAccessibilityFeaturesChanged();`
after `EnginePlatformDispatcher.instance.configuration =
newConfiguration` to notify update configuration event to `MediaQuery`.

before


https://github.com/user-attachments/assets/89969cc7-f9fa-4ac0-8ce0-d026d5676f27

after


https://github.com/user-attachments/assets/8a284d42-e344-4039-8569-8567956326b7

<details>

<summary>Example Code</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';

void main() {
  runApp(const MaterialApp(home: MyHomePage()));
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                SemanticsBinding.instance.ensureSemantics();
              },
              child: const Text('Enable a11y'),
            ),
            const SizedBox(height: 24),
            ElevatedButton(
              onPressed: () {
                ScaffoldMessenger.of(context).showSnackBar(
                  SnackBar(
                    content: const Text('Should stay visible'),
                    action: SnackBarAction(label: 'Action', onPressed: () {}),
                  ),
                );
              },
              child: const Text('Show snackbar'),
            ),
            const SizedBox(height: 24),
            Text(
              'MediaQuery.accessibleNavigationOf(context): ${MediaQuery.accessibleNavigationOf(context)}',
            ),
            Text(
              'SemanticsBinding.instance.semanticsEnabled: ${SemanticsBinding.instance.semanticsEnabled}',
            ),
            Text(
              'SemanticsBinding.instance.platformDispatcher.semanticsEnabled: ${SemanticsBinding.instance.platformDispatcher.semanticsEnabled}',
            ),
            Text(
              'SemanticsBinding.instance.accessibilityFeatures: ${SemanticsBinding.instance.accessibilityFeatures}',
            ),
          ],
        ),
      ),
    );
  }
}
```

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

---------

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
Co-authored-by: Mouad Debbar <mouad.debbar@gmail.com>
2025-06-02 13:58:26 +00:00
Bruno Leroux
0b3ba809cc
Revert "Fix NavigationBar indicator overlay color (#164484)" (#169497)
## Description

This PR reverts the change from [Fix NavigationBar indicator overlay
color](https://github.com/flutter/flutter/pull/164484) as it leads to
several regressions.

The change was very small: replacing a Container (which obscured the
overlay) with an Ink. Unfortunately this leads to some rendering issues
which seem related to the Ink painting not being fully in sync with the
animation logic implemented by `NavigationIndicator`.
I investigated this but did not find an obvious solution. So I would
prefer to revert https://github.com/flutter/flutter/pull/164484 as the
issue it fixed has less impact than the regression.
cc @justinmc for review and also in case you have some clue about why an
Ink would cause such problems compared to a Container.

## Related Issue

Fixes [[Flutter 3.32.0] Active NavigationBar item not selected when
switching items
programmatically](https://github.com/flutter/flutter/issues/169249)
Fixes [NavigationDrawer active indicator offset with
SvgPicture](https://github.com/flutter/flutter/issues/169436)
Fixes
https://github.com/flutter/flutter/pull/164484#issuecomment-2910505630

Reopens https://github.com/flutter/flutter/issues/163871
2025-06-02 08:00:46 +00:00
chunhtai
3c28bb7a24
Removes elevation and thickness from semantics r2 (#169382)
<!--
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
-->

same as https://github.com/flutter/flutter/pull/168703, but previous pr
seems bugged github

## 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
2025-05-30 21:57:30 +00:00
fewling
f182421dd2
Add header and footer support to NavigationDrawer (#168005)
<!--
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
-->
## Description

This PR attempts to add header and footer for `NavigationDrawer` widget
as shown below:

![sample](https://github.com/user-attachments/assets/f3adefe9-7c4e-4169-a72b-d5beffc7b73a)

## Issues are fixed by this PR

- #127621 
- #135750 (partially)

## 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-05-29 20:33:26 +00:00
Tong Mu
df5f865a6b
[Cupertino] Apply RSuperellipse to most Cupertino widgets (#167784)
This PR applies RSuperellipse to most Cupertino widgets. I got the list
by searching for `ClipRRect`, `drawRRect`, and `BoxDecoration` (with
`borderRadius`) through the package. They're replaced by
`ClipRSuperellipse`, `drawRSuperellipse`, and `ShapeDecoration`
respectively.

There are a few widgets that I didn't apply:
* `CupertinoTextField` as well as its related widget
`CupertinoSearchTextField`, because `CupertinoTextField` expects a
`BoxDecoration` argument. Migrating it is nontrivial and will take place
in a separate PR.
* `CupertinoTextSelectionToolbar`, because it seems complicated
(containing a lot of paths). I wonder if it's possible to replace the
clipPath with clipRRect/clipRSe for better performance.
* `CupertinoSwitch`. I suspect it's not an squircle since it tightly
contains a full circle.

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

## 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
2025-05-26 21:55:10 +00:00
Felipe Morschel
c15a2c6c47
Removes unnecessary parentheses (#169015)
This is solely a change to allow the CL for
https://github.com/dart-lang/sdk/issues/59069 to land.

## Pre-launch Checklist

- [x] 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.
- [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.
2025-05-23 00:02:01 +00:00
Renzo Olivares
c31247a7b3
Fix crash on two finger selection gesture (#168598)
This change blocks two selection handles from being able to be dragged
simultaneously on iOS and the web, this matches the native behavior. On
native Android both handles can still be dragged simultaneously this is
the behavior observed on Google Keep/ Google Messages and Android's
EditText.

Also fixes an issue on iOS where the magnifier would not return after
hiding when double tapping and dragging to select and then dragging
outside the TextField area. The cause of this issue was because
editableText.showMagnifier decides whether to update the magnifier
position or show a new one based on whether it was visible, so when it
was hidden and we attempt to update it's position, it would try to show
a new magnifier which left the magnifier in a broken state. This change
makes editableText.showMagnifier depend on whether a magnifier exists
instead of just checking it's visibility. Similarly
editableText.hideMagnifier now does not depend on the magnifier
visibility, instead it internally (selectionOverlay.hideMagnifier)
checks if the magnifier exists.

Fixes #168578

## 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>
2025-05-22 21:43:54 +00:00
chunhtai
8d2c9782e3
Fixes tab semantics gets dropped if the child produce a semantics node (#169233)
<!--
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
-->

fixes https://github.com/flutter/flutter/issues/169175

the bug is due to the image widget will create it own semanitc node and
force the semantics widget in the stack to form its own node instead of
merge up. Modify the code so that it works correctly.

## 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
2025-05-22 21:06:03 +00:00