Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Jun 18, 2025

Description

This PR renames the DropdownButtonFormField constuctor parameter 'value' to 'initialValue'.
See #170050 (comment) and #170050 (comment) for some context.

Related Issue

Fixes DropdownButtonFormField retains selected value even after setting value to null

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos c: tech-debt Technical debt, code quality, testing, etc. labels Jun 18, 2025
@bleroux bleroux force-pushed the add_DropdownButtonFormField_initialValue_parameter branch from 46619bf to 905065d Compare June 18, 2025 14:36
@dkwingsmt dkwingsmt changed the title Deprecate DropdownDownFormField "value" parameter in favor of "initialValue" Deprecate DropdownButtonFormField "value" parameter in favor of "initialValue" Jun 18, 2025
@dkwingsmt dkwingsmt requested a review from justinmc June 18, 2025 18:24
@bleroux bleroux force-pushed the add_DropdownButtonFormField_initialValue_parameter branch 3 times, most recently from 60181fd to 4a05629 Compare June 23, 2025 17:02
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.

LGTM 👍 Thanks for changing this. I think it's important that we get these kinds of declarative patterns right.

@bleroux bleroux force-pushed the add_DropdownButtonFormField_initialValue_parameter branch from 4a05629 to 6d7dbbb Compare June 24, 2025 05:30
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jun 24, 2025
Merged via the queue into flutter:master with commit 0adb033 Jun 24, 2025
69 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2025
@bleroux bleroux deleted the add_DropdownButtonFormField_initialValue_parameter branch June 24, 2025 08:01
github-merge-queue bot pushed a commit that referenced this pull request Jun 24, 2025
## Description

This PR updates `FormField.initialValue` documentation to remove a
sentence which is obsolete since
#170805.

## Tests

Documentation only PR.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 24, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 25, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 26, 2025
Roll Flutter from d733bea to 2773c0c (42 revisions)

flutter/flutter@d733bea...2773c0c

2025-06-25 jason-simmons@users.noreply.github.com Log stack traces from exceptions thrown by devicelab test tasks (flutter/flutter#171165)
2025-06-25 mdebbar@google.com Revert "Move `web_long_running_tests_{1,5}_5` to `bringup`." (flutter/flutter#171100)
2025-06-25 bruno.leroux@gmail.com Add missing M3 tests for InputDecoration.isDense (flutter/flutter#171058)
2025-06-25 34871572+gmackall@users.noreply.github.com Add Android specific sub-step to validate the Android sdk path has no spaces (flutter/flutter#170829)
2025-06-24 737941+loic-sharma@users.noreply.github.com Update foundation library to export internal (flutter/flutter#170563)
2025-06-24 matanlurey@users.noreply.github.com Remove stale references to `Release-process.md` and `conductor` (flutter/flutter#171046)
2025-06-24 30870216+gaaclarke@users.noreply.github.com License cpp jun23 (flutter/flutter#171047)
2025-06-24 magder@google.com Add android-reviewers to CODEOWNERS (flutter/flutter#170157)
2025-06-24 srawlins@google.com Update tool/README.md regarding locally-built engine (flutter/flutter#171102)
2025-06-24 mdebbar@google.com [web] Align the PR triage process with the ecosystem's triage flow (flutter/flutter#171086)
2025-06-24 danny@tuppeny.com [flutter_tool] Migrate DAP off `ProcessUtils.writelnToStdinUnsafe` (flutter/flutter#171081)
2025-06-24 mdebbar@google.com [web] More granular configuration of the test environment (flutter/flutter#168767)
2025-06-24 127918074+salemiranloye@users.noreply.github.com Clean up Devfs_Web into separate files (flutter/flutter#170769)
2025-06-24 59215665+davidhicks980@users.noreply.github.com Add RawMenuAnchor animation callbacks (flutter/flutter#167806)
2025-06-24 jason-simmons@users.noreply.github.com Support wide gamut colors when applying a DlColor to an SkPaint (flutter/flutter#170613)
2025-06-24 nshahan@google.com Remove temporary workaround for web testing (flutter/flutter#170949)
2025-06-24 engine-flutter-autoroll@skia.org Roll Packages from 02770da to d9d3191 (6 revisions) (flutter/flutter#171075)
2025-06-24 15619084+vashworth@users.noreply.github.com Add LLDB warnings (flutter/flutter#170827)
2025-06-24 bruno.leroux@gmail.com Update FormField.initialValue documentation (flutter/flutter#171061)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from 132cb2052565 to a462e701b493 (2 revisions) (flutter/flutter#171063)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from f88706e3a863 to 132cb2052565 (4 revisions) (flutter/flutter#171057)
2025-06-24 zeqinjie@qq.com When maintainHintSize is false, hint is centered and aligned, it is different from the original one (flutter/flutter#168654)
2025-06-24 bruno.leroux@gmail.com Deprecate DropdownButtonFormField "value" parameter in favor of "initialValue" (flutter/flutter#170805)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from af6feb799ea6 to f88706e3a863 (2 revisions) (flutter/flutter#171056)
2025-06-24 engine-flutter-autoroll@skia.org Roll Dart SDK from aebd78999b1a to d9edd9e7a634 (1 revision) (flutter/flutter#171053)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from ae517eba0170 to af6feb799ea6 (1 revision) (flutter/flutter#171052)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from a7735d517e6a to ae517eba0170 (9 revisions) (flutter/flutter#171049)
2025-06-24 rmacnak@google.com Enable interpretation fallback when unable to JIT on iOS. (flutter/flutter#170835)
2025-06-24 kevmoo@users.noreply.github.com Flutter test cleanup (flutter/flutter#170891)
2025-06-24 matanlurey@users.noreply.github.com Move `packages_autoroller` out of the carcass of `conductor`, delete `conductor` (flutter/flutter#171029)
2025-06-23 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Don't strip symbols from `libapp.so` on android by default (#162464)" (flutter/flutter#171044)
2025-06-23 engine-flutter-autoroll@skia.org Roll Dart SDK from a09de0d3556c to aebd78999b1a (2 revisions) (flutter/flutter#171039)
2025-06-23 34871572+gmackall@users.noreply.github.com Don't strip symbols from `libapp.so` on android by default (flutter/flutter#162464)
2025-06-23 engine-flutter-autoroll@skia.org Roll Skia from 0311837abe86 to a7735d517e6a (12 revisions) (flutter/flutter#171037)
2025-06-23 bungeman@chromium.org Pass font scanner to font mgr that need it (flutter/flutter#170701)
2025-06-23 jacksongardner@google.com Make service worker tests more lenient. (flutter/flutter#170939)
2025-06-23 737941+loic-sharma@users.noreply.github.com Remove update CHANGELOG step from stable cherry pick process (flutter/flutter#171017)
2025-06-23 15619084+vashworth@users.noreply.github.com Include dev_dependencies in all builds for iOS and macOS (flutter/flutter#171015)
2025-06-23 matanlurey@users.noreply.github.com Move `web_long_running_tests_{1,5}_5` to `bringup`. (flutter/flutter#171026)
2025-06-23 muhatashim@google.com rename from announce to supportsAnnounce on engine (flutter/flutter#170618)
2025-06-23 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#171016)
2025-06-23 azat24680@gmail.com Enhance Text Contrast for WCAG AAA Compliance (flutter/flutter#170758)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
...
sfshaza2 added a commit to flutter/website that referenced this pull request Jun 30, 2025
This PR adds a migration guide for `DropdownButtonFormField.value`.

Related PRs:
- flutter/flutter#170805

## Presubmit checklist

- [ ] This PR is marked as draft with an explanation if not meant to
land until a future stable release.
- [X] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [X] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [X] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Shams Zakhour (ignore Sfshaza) <44418985+sfshaza2@users.noreply.github.com>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 21, 2025
…ialValue" (flutter#170805)

## Description

This PR renames the DropdownButtonFormField constuctor parameter 'value'
to 'initialValue'.
See
flutter#170050 (comment)
and
flutter#170050 (comment)
for some context.

## Related Issue

Fixes [DropdownButtonFormField retains selected value even after setting
value to null](flutter#169983 (comment))

## 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).
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 21, 2025
## Description

This PR updates `FormField.initialValue` documentation to remove a
sentence which is obsolete since
flutter#170805.

## Tests

Documentation only PR.
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
Roll Flutter from d733bea to 2773c0c (42 revisions)

flutter/flutter@d733bea...2773c0c

2025-06-25 jason-simmons@users.noreply.github.com Log stack traces from exceptions thrown by devicelab test tasks (flutter/flutter#171165)
2025-06-25 mdebbar@google.com Revert "Move `web_long_running_tests_{1,5}_5` to `bringup`." (flutter/flutter#171100)
2025-06-25 bruno.leroux@gmail.com Add missing M3 tests for InputDecoration.isDense (flutter/flutter#171058)
2025-06-25 34871572+gmackall@users.noreply.github.com Add Android specific sub-step to validate the Android sdk path has no spaces (flutter/flutter#170829)
2025-06-24 737941+loic-sharma@users.noreply.github.com Update foundation library to export internal (flutter/flutter#170563)
2025-06-24 matanlurey@users.noreply.github.com Remove stale references to `Release-process.md` and `conductor` (flutter/flutter#171046)
2025-06-24 30870216+gaaclarke@users.noreply.github.com License cpp jun23 (flutter/flutter#171047)
2025-06-24 magder@google.com Add android-reviewers to CODEOWNERS (flutter/flutter#170157)
2025-06-24 srawlins@google.com Update tool/README.md regarding locally-built engine (flutter/flutter#171102)
2025-06-24 mdebbar@google.com [web] Align the PR triage process with the ecosystem's triage flow (flutter/flutter#171086)
2025-06-24 danny@tuppeny.com [flutter_tool] Migrate DAP off `ProcessUtils.writelnToStdinUnsafe` (flutter/flutter#171081)
2025-06-24 mdebbar@google.com [web] More granular configuration of the test environment (flutter/flutter#168767)
2025-06-24 127918074+salemiranloye@users.noreply.github.com Clean up Devfs_Web into separate files (flutter/flutter#170769)
2025-06-24 59215665+davidhicks980@users.noreply.github.com Add RawMenuAnchor animation callbacks (flutter/flutter#167806)
2025-06-24 jason-simmons@users.noreply.github.com Support wide gamut colors when applying a DlColor to an SkPaint (flutter/flutter#170613)
2025-06-24 nshahan@google.com Remove temporary workaround for web testing (flutter/flutter#170949)
2025-06-24 engine-flutter-autoroll@skia.org Roll Packages from 02770da to d9d3191 (6 revisions) (flutter/flutter#171075)
2025-06-24 15619084+vashworth@users.noreply.github.com Add LLDB warnings (flutter/flutter#170827)
2025-06-24 bruno.leroux@gmail.com Update FormField.initialValue documentation (flutter/flutter#171061)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from 132cb2052565 to a462e701b493 (2 revisions) (flutter/flutter#171063)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from f88706e3a863 to 132cb2052565 (4 revisions) (flutter/flutter#171057)
2025-06-24 zeqinjie@qq.com When maintainHintSize is false, hint is centered and aligned, it is different from the original one (flutter/flutter#168654)
2025-06-24 bruno.leroux@gmail.com Deprecate DropdownButtonFormField "value" parameter in favor of "initialValue" (flutter/flutter#170805)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from af6feb799ea6 to f88706e3a863 (2 revisions) (flutter/flutter#171056)
2025-06-24 engine-flutter-autoroll@skia.org Roll Dart SDK from aebd78999b1a to d9edd9e7a634 (1 revision) (flutter/flutter#171053)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from ae517eba0170 to af6feb799ea6 (1 revision) (flutter/flutter#171052)
2025-06-24 engine-flutter-autoroll@skia.org Roll Skia from a7735d517e6a to ae517eba0170 (9 revisions) (flutter/flutter#171049)
2025-06-24 rmacnak@google.com Enable interpretation fallback when unable to JIT on iOS. (flutter/flutter#170835)
2025-06-24 kevmoo@users.noreply.github.com Flutter test cleanup (flutter/flutter#170891)
2025-06-24 matanlurey@users.noreply.github.com Move `packages_autoroller` out of the carcass of `conductor`, delete `conductor` (flutter/flutter#171029)
2025-06-23 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Don't strip symbols from `libapp.so` on android by default (#162464)" (flutter/flutter#171044)
2025-06-23 engine-flutter-autoroll@skia.org Roll Dart SDK from a09de0d3556c to aebd78999b1a (2 revisions) (flutter/flutter#171039)
2025-06-23 34871572+gmackall@users.noreply.github.com Don't strip symbols from `libapp.so` on android by default (flutter/flutter#162464)
2025-06-23 engine-flutter-autoroll@skia.org Roll Skia from 0311837abe86 to a7735d517e6a (12 revisions) (flutter/flutter#171037)
2025-06-23 bungeman@chromium.org Pass font scanner to font mgr that need it (flutter/flutter#170701)
2025-06-23 jacksongardner@google.com Make service worker tests more lenient. (flutter/flutter#170939)
2025-06-23 737941+loic-sharma@users.noreply.github.com Remove update CHANGELOG step from stable cherry pick process (flutter/flutter#171017)
2025-06-23 15619084+vashworth@users.noreply.github.com Include dev_dependencies in all builds for iOS and macOS (flutter/flutter#171015)
2025-06-23 matanlurey@users.noreply.github.com Move `web_long_running_tests_{1,5}_5` to `bringup`. (flutter/flutter#171026)
2025-06-23 muhatashim@google.com rename from announce to supportsAnnounce on engine (flutter/flutter#170618)
2025-06-23 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#171016)
2025-06-23 azat24680@gmail.com Enhance Text Contrast for WCAG AAA Compliance (flutter/flutter#170758)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: tech-debt Technical debt, code quality, testing, etc. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos 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 retains selected value even after setting value to null

2 participants