From 7c50267fa01715d95a3ad4c2848f951b329f7f35 Mon Sep 17 00:00:00 2001 From: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:52:20 +0000 Subject: [PATCH] Doc fix for `DropdownButtonFormField.value` (#144427) Fixes https://github.com/flutter/flutter/issues/144135 This PR is just a doc fix. --- packages/flutter/lib/src/material/dropdown.dart | 2 ++ packages/flutter/lib/src/widgets/form.dart | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 21326190dae..017c5cad0bd 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -1555,6 +1555,8 @@ class _DropdownButtonState extends State> with WidgetsBindi /// pass a [GlobalKey] to the constructor and use [GlobalKey.currentState] to /// save or reset the form field. /// +/// The `value` parameter maps to [FormField.initialValue]. +/// /// See also: /// /// * [DropdownButton], which is the underlying text field without the [Form] diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart index 657bb04280b..2211523a4a6 100644 --- a/packages/flutter/lib/src/widgets/form.dart +++ b/packages/flutter/lib/src/widgets/form.dart @@ -445,6 +445,9 @@ class FormField extends StatefulWidget { final FormFieldBuilder builder; /// An optional value to initialize the form field to, or null otherwise. + /// + /// This is called `value` in the [DropdownButtonFormField] constructor to be + /// consistent with [DropdownButton]. final T? initialValue; /// Whether the form is able to receive user input.