Skip to content

Commit 81672ce

Browse files
author
BrottarBasse
committed
Merge remote-tracking branch 'origin/fix-issue-1350' into fix-issue-1350
2 parents db74044 + f66b7ac commit 81672ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/src/fields/form_builder_dropdown.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
218218
/// are defined by the corresponding properties of the [borderRadius].
219219
final BorderRadius? borderRadius;
220220

221+
/// A placeholder widget that is displayed by the dropdown button.
222+
///
223+
/// If [value] is null and the dropdown is enabled ([items] and [onChanged] are non-null),
224+
/// this widget is displayed as a placeholder for the dropdown button's value.
225+
///
226+
/// If [value] is null and the dropdown is disabled and [disabledHint] is null,
227+
/// this widget is used as the placeholder.
228+
final Widget? hint;
229+
221230
/// Creates field for Dropdown button
222231
FormBuilderDropdown({
223232
super.key,
@@ -253,6 +262,7 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
253262
this.enableFeedback,
254263
this.borderRadius,
255264
this.alignment = AlignmentDirectional.centerStart,
265+
this.hint,
256266
}) : super(
257267
builder: (FormFieldState<T?> field) {
258268
final state = field as _FormBuilderDropdownState<T>;
@@ -289,6 +299,7 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
289299
borderRadius: borderRadius,
290300
enableFeedback: enableFeedback,
291301
alignment: alignment,
302+
hint: hint,
292303
);
293304
},
294305
);

0 commit comments

Comments
 (0)