Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

docs.flutter.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more

Flutter 3.41 is live! Check out theFlutter 3.41 blog post!

Deprecated the 'value' parameter of the 'DropdownButtonFormField' constructor

The `DropdownButtonFormField` constructor parameter `value` has been replaced by the parameter `initialValue`.

Important

Summary

#

Thevalue parameter of theDropdownButtonFormField constructor was deprecated in favor of theinitialValue parameter.

Context

#

Thevalue parameter of theDropdownButtonFormField constructor was used to initializeDropdownButtonFormField.initialValue. Not using the same name was confusing. For example, developers falsely assumed that settingvalue would change the current selected value. This was not the case—it only set the initial value or when the field is reset.

Description of change

#

Thevalue parameter of theDropdownButtonFormField constructor is deprecated in favor of the parameter namedinitialValue.

Migration guide

#

Replace thevalue parameter of theDropdownButtonFormField constructor with theinitialValue parameter to initializeDropdownButtonFormField.initialValue.

Code before migration:

dart
DropdownButtonFormField(value:'Yellow',),

Code after migration:

dart
DropdownButtonFormField(initialValue:'Yellow',),

Timeline

#

Landed in version: 3.35.0-0.0.pre
In stable release: 3.35

References

#

API documentation:

Relevant issues:

Relevant PRs:

Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2025-10-28.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp