Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Jul 29, 2024

Description

This PR makes DropdownButtonFormField hint defaults to the provided inputDecoration hintText.

Because DropDownButtonFormField accepts both a hint parameter and a decorationparameter, one can expect InputDecoration.hintText to be valid.

Before this PR, when InputDecoration.hintText was specified, it is shown but the vertical position is wrong.
After this PR, when InputDecoration.hintText is specified, it is used as the default value for DropDownButtonFormField.hint and DropDownButtonFormField.disabledHint.

Before After
image image

Related Issue

Fixes #111958.

Tests

Adds 5 tests.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 29, 2024
@bleroux bleroux force-pushed the use_decoration_hint_text_as_the_default_value_for_dropdownButton_hints branch from 500fb19 to 7d4ab76 Compare July 29, 2024 08:48
@bleroux bleroux force-pushed the use_decoration_hint_text_as_the_default_value_for_dropdownButton_hints branch from 7d4ab76 to 676f86e Compare July 29, 2024 11:35
@bleroux bleroux requested a review from justinmc July 29, 2024 12:21
@bleroux
Copy link
Contributor Author

bleroux commented Jul 29, 2024

@justinmc
To make it easier to review, this PR has 3 commits, the main change is in the first commit. The second commit updates the formatting which makes the diff harder to review.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Thank you for the guidance on reviewing by commit, that was much easier! LGTM 👍

expect(tester.getTopLeft(find.text(hintText,skipOffstage: false)).dx, 348.0);
expect(tester.getTopLeft(find.text(hintText,skipOffstage: false)).dy, 292.0);
expect(tester.getTopLeft(find.text(hintText, skipOffstage: false)).dx, 348.0);
expect(tester.getTopLeft(find.text(hintText, skipOffstage: false)).dy, 292.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch on these spaces.

@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 31, 2024
@auto-submit auto-submit bot merged commit 1a8e57f into flutter:master Jul 31, 2024
@bleroux bleroux deleted the use_decoration_hint_text_as_the_default_value_for_dropdownButton_hints branch July 31, 2024 11:50
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 3, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 3, 2024
Manual roll Flutter from 85960d2 to 4ff9462 (45 revisions)

Manual roll requested by stuartmorgan@google.com

flutter/flutter@85960d2...4ff9462

2024-08-01 matanlurey@users.noreply.github.com Fix local testing, gradle XML errors, and enable on CI. (flutter/flutter#152383)
2024-08-01 32538273+ValentinVignal@users.noreply.github.com Fix formatting issues in `search_anchor.0_test.dart` (flutter/flutter#152669)
2024-08-01 32538273+ValentinVignal@users.noreply.github.com Add tests for search anchor examples (flutter/flutter#152659)
2024-08-01 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4dc94d6f88ba to 7c4a44611abe (1 revision) (flutter/flutter#152665)
2024-08-01 engine-flutter-autoroll@skia.org Roll Flutter Engine from f546fef7d7cd to 4dc94d6f88ba (1 revision) (flutter/flutter#152663)
2024-08-01 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0fbff219c498 to f546fef7d7cd (2 revisions) (flutter/flutter#152661)
2024-08-01 engine-flutter-autoroll@skia.org Roll Flutter Engine from 32f788823f43 to 0fbff219c498 (5 revisions) (flutter/flutter#152658)
2024-08-01 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 32f788823f43 to ed95b491f260 (3 revisions) (flutter/flutter#152654)
2024-08-01 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 16332725788c to 32f788823f43 (11 revisions) (flutter/flutter#152648)
2024-07-31 dkwingsmt@users.noreply.github.com [CupertinoActionSheet] Make `_ActionSheetButtonBackground` stateless (flutter/flutter#152283)
2024-07-31 nate.w5687@gmail.com Implementing null-aware logic in `/packages/flutter/` (flutter/flutter#152294)
2024-07-31 andrewrkolos@gmail.com Reintroduce verbose logging for hot reload flake (flutter/flutter#152639)
2024-07-31 59215665+davidhicks980@users.noreply.github.com [material/menu_anchor.dart] Remove unused early key event listener (flutter/flutter#150915)
2024-07-31 victorsanniay@gmail.com Improve `CupertinoCheckbox` fidelity (flutter/flutter#151441)
2024-07-31 43054281+camsim99@users.noreply.github.com Update docs to support new Android version (flutter/flutter#152503)
2024-07-31 43054281+camsim99@users.noreply.github.com [Android] Update integration test AVD dependency to use Android 35 emulators (flutter/flutter#152498)
2024-07-31 rmolivares@renzo-olivares.dev Shift + click gesture support for SelectionArea on desktop platforms (flutter/flutter#148574)
2024-07-31 tessertaha@gmail.com Add ability to clip `Stepper` step content (flutter/flutter#152370)
2024-07-31 58190796+MitchellGoodwin@users.noreply.github.com Calendar font factor (flutter/flutter#152341)
2024-07-31 ian@hixie.ch Remove redundant usages of zones in skia_client.dart (flutter/flutter#149366)
2024-07-31 34871572+gmackall@users.noreply.github.com Set up tests that verify we can build a fresh counter app across our Gradle/AGP/Kotlin support range (flutter/flutter#151568)
2024-07-31 andrewrkolos@gmail.com remove bringup from Windows tool_integration_tests_* (flutter/flutter#152599)
2024-07-31 38110731+aliasgar4558@users.noreply.github.com � : Animation controller now has ability to repeat animation 'n' no. of times. (flutter/flutter#150764)
2024-07-31 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3b31b21599d1 to 16332725788c (1 revision) (flutter/flutter#152631)
2024-07-31 engine-flutter-autoroll@skia.org Roll Flutter Engine from b73367a30e9b to 3b31b21599d1 (8 revisions) (flutter/flutter#152625)
2024-07-31 engine-flutter-autoroll@skia.org Roll Packages from 99e8606 to 46a712f (8 revisions) (flutter/flutter#152622)
2024-07-31 32538273+ValentinVignal@users.noreply.github.com Add tests for scaffold messenger examples (flutter/flutter#152536)
2024-07-31 32538273+ValentinVignal@users.noreply.github.com Add test for search_anchor.0.dart (flutter/flutter#152371)
2024-07-31 bruno.leroux@gmail.com Use decoration hint text as the default value for dropdown button hints (flutter/flutter#152474)
2024-07-31 bruno.leroux@gmail.com Deprecate invalid InputDecoration.collapsed parameters (flutter/flutter#152486)
2024-07-31 andrewrkolos@gmail.com increase sharding on Windows tool_integration_tests (flutter/flutter#152582)
2024-07-31 engine-flutter-autoroll@skia.org Roll Flutter Engine from e2ece7e58480 to b73367a30e9b (4 revisions) (flutter/flutter#152592)
2024-07-31 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0b42657a184e to e2ece7e58480 (2 revisions) (flutter/flutter#152589)
2024-07-31 engine-flutter-autoroll@skia.org Roll Flutter Engine from 08f9be3ab284 to 0b42657a184e (2 revisions) (flutter/flutter#152586)
2024-07-30 matanlurey@users.noreply.github.com Clarify and cleanup the test-exemption wording in tree-hygiene. (flutter/flutter#152402)
2024-07-30 ditman@gmail.com [web] Set COEP:credentialless on flutter run/drive. (flutter/flutter#152413)
2024-07-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from a4b88a37d511 to 08f9be3ab284 (5 revisions) (flutter/flutter#152583)
2024-07-30 fluttergithubbot@gmail.com Marks Mac platform_channel_sample_test_macos to be flaky (flutter/flutter#151884)
2024-07-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from a6c5ff26c266 to a4b88a37d511 (2 revisions) (flutter/flutter#152575)
2024-07-30 jhy03261997@gmail.com Reland #151599 (Add button semantics in list tile ) with a flag to control behavior.  (flutter/flutter#152526)
2024-07-30 zanderso@users.noreply.github.com Shift macOS/Android tests from Pixel 7 to mokey in staging (flutter/flutter#152571)
2024-07-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 31bb9f98472a to a6c5ff26c266 (5 revisions) (flutter/flutter#152573)
2024-07-30 engine-flutter-autoroll@skia.org Roll Packages from 247fb5f to 99e8606 (5 revisions) (flutter/flutter#152567)
2024-07-30 tessertaha@gmail.com Fix default avatar icon theme size for Material 2 (flutter/flutter#152307)
...
Copy link

@ebjorklund01 ebjorklund01 left a comment

Choose a reason for hiding this comment

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

🙌

TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…ts (flutter#152474)

## Description

This PR makes `DropdownButtonFormField` hint defaults to the provided inputDecoration hintText.

Because `DropDownButtonFormField` accepts both a `hint` parameter and a `decoration`parameter, one can expect `InputDecoration.hintText` to be valid.

Before this PR, when `InputDecoration.hintText` was specified, it is shown but the vertical position is wrong.
After this PR, when `InputDecoration.hintText` is specified, it is used as the default value for `DropDownButtonFormField.hint` and `DropDownButtonFormField.disabledHint`.

| Before | After |
|--------|--------|
| ![image](https://github.com/user-attachments/assets/a08ff75c-edd4-4e16-9cfa-98ddb349d860) | ![image](https://github.com/user-attachments/assets/55f08bee-8f88-4125-8fae-68e2be724955) |

## Related Issue

Fixes flutter#111958.

## Tests

Adds 5 tests.
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…ts (flutter#152474)

## Description

This PR makes `DropdownButtonFormField` hint defaults to the provided inputDecoration hintText.

Because `DropDownButtonFormField` accepts both a `hint` parameter and a `decoration`parameter, one can expect `InputDecoration.hintText` to be valid.

Before this PR, when `InputDecoration.hintText` was specified, it is shown but the vertical position is wrong.
After this PR, when `InputDecoration.hintText` is specified, it is used as the default value for `DropDownButtonFormField.hint` and `DropDownButtonFormField.disabledHint`.

| Before | After |
|--------|--------|
| ![image](https://github.com/user-attachments/assets/a08ff75c-edd4-4e16-9cfa-98ddb349d860) | ![image](https://github.com/user-attachments/assets/55f08bee-8f88-4125-8fae-68e2be724955) |

## Related Issue

Fixes flutter#111958.

## Tests

Adds 5 tests.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DropdownButtonFormField's hintText is not vertically centered if items is null or empty

3 participants