From dde5efd44af32bc368f7a45da719f9bcbb497738 Mon Sep 17 00:00:00 2001 From: hosain-mohamed Date: Sun, 1 Sep 2024 17:39:27 +0300 Subject: [PATCH 1/2] add hint to FormBuilderDropdown --- lib/src/fields/form_builder_dropdown.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/fields/form_builder_dropdown.dart b/lib/src/fields/form_builder_dropdown.dart index fcda45b7f..b5096662d 100644 --- a/lib/src/fields/form_builder_dropdown.dart +++ b/lib/src/fields/form_builder_dropdown.dart @@ -253,6 +253,7 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { this.enableFeedback, this.borderRadius, this.alignment = AlignmentDirectional.centerStart, + Widget? hint, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderDropdownState; @@ -289,6 +290,7 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { borderRadius: borderRadius, enableFeedback: enableFeedback, alignment: alignment, + hint: hint, ); }, ); From e25df8c00a80c37cd5b5fbf97f577796f65573fc Mon Sep 17 00:00:00 2001 From: hosain-mohamed Date: Mon, 2 Sep 2024 11:36:33 +0300 Subject: [PATCH 2/2] Add | final widget hint --- lib/src/fields/form_builder_dropdown.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/src/fields/form_builder_dropdown.dart b/lib/src/fields/form_builder_dropdown.dart index b5096662d..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,7 +262,7 @@ class FormBuilderDropdown extends FormBuilderFieldDecoration { this.enableFeedback, this.borderRadius, this.alignment = AlignmentDirectional.centerStart, - Widget? hint, + this.hint, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderDropdownState;