diff --git a/lib/src/fields/form_builder_dropdown.dart b/lib/src/fields/form_builder_dropdown.dart index fcda45b7f..6a3250380 100644 --- a/lib/src/fields/form_builder_dropdown.dart +++ b/lib/src/fields/form_builder_dropdown.dart @@ -218,6 +218,15 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { /// are defined by the corresponding properties of the [borderRadius]. final BorderRadius? borderRadius; + /// A placeholder widget that is displayed by the dropdown button. + /// + /// If [value] is null and the dropdown is enabled ([items] and [onChanged] are non-null), + /// this widget is displayed as a placeholder for the dropdown button's value. + /// + /// If [value] is null and the dropdown is disabled and [disabledHint] is null, + /// this widget is used as the placeholder. + final Widget? hint; + /// Creates field for Dropdown button FormBuilderDropdown({ super.key, @@ -253,6 +262,7 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { this.enableFeedback, this.borderRadius, this.alignment = AlignmentDirectional.centerStart, + this.hint, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderDropdownState; @@ -289,6 +299,7 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { borderRadius: borderRadius, enableFeedback: enableFeedback, alignment: alignment, + hint: hint, ); }, );