Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecate DropdownButtonFormField "value" parameter in favor of "initialValue" #170805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 from 905065d to ff71001 Compare June 18, 2025 20:28
@bleroux bleroux force-pushed the add_DropdownButtonFormField_initialValue_parameter branch from ff71001 to 60181fd Compare June 18, 2025 21:30
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
1 participant