Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/src/fields/form_builder_dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
/// 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,
Expand Down Expand Up @@ -253,6 +262,7 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
this.enableFeedback,
this.borderRadius,
this.alignment = AlignmentDirectional.centerStart,
this.hint,
}) : super(
builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderDropdownState<T>;
Expand Down Expand Up @@ -289,6 +299,7 @@ class FormBuilderDropdown<T> extends FormBuilderFieldDecoration<T> {
borderRadius: borderRadius,
enableFeedback: enableFeedback,
alignment: alignment,
hint: hint,
);
},
);
Expand Down
Loading