Skip to content

Commit

Permalink
reactive_dropdown_button2 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilich6107 committed Sep 26, 2023
1 parent ef63799 commit 7ebb59e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 30 deletions.
6 changes: 4 additions & 2 deletions packages/reactive_dropdown_button2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [1.0.0]
* reactive_forms update
## 0.0.2

* error display support

## 0.0.1

* initial release
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ class ReactiveDropdownButton2<T, V> extends ReactiveFocusableFormField<T, V> {
FocusNode? focusNode,

//////////////////////////////////////////////////////////////////////////
InputDecoration inputDecoration = const InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.fromLTRB(0, 0, 0, 0),
isDense: true,
isCollapsed: true,
),
List<DropdownMenuItem<V>>? items,
DropdownButtonBuilder? selectedItemBuilder,
T? value,
Expand Down Expand Up @@ -116,33 +122,42 @@ class ReactiveDropdownButton2<T, V> extends ReactiveFocusableFormField<T, V> {
showErrors: showErrors,
focusNode: focusNode,
builder: (field) {
return DropdownButton2<V>(
key: widgetKey,
items: items ?? [],
selectedItemBuilder: selectedItemBuilder,
value: field.value,
hint: hint,
disabledHint: disabledHint,
onChanged: field.didChange,
onMenuStateChange: onMenuStateChange,
style: style,
underline: underline,
isDense: isDense,
isExpanded: isExpanded,
focusNode: field.focusNode,
autofocus: autofocus,
enableFeedback: enableFeedback,
alignment: alignment,
buttonStyleData: buttonStyleData,
iconStyleData: iconStyleData,
dropdownStyleData: dropdownStyleData,
menuItemStyleData: menuItemStyleData,
dropdownSearchData: dropdownSearchData,
customButton: customButton,
openWithLongPress: openWithLongPress,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
final effectiveDecoration = inputDecoration
.applyDefaults(Theme.of(field.context).inputDecorationTheme);

return InputDecorator(
decoration: effectiveDecoration.copyWith(
errorText: field.errorText,
enabled: field.control.enabled,
),
child: DropdownButton2<V>(
key: widgetKey,
items: items ?? [],
selectedItemBuilder: selectedItemBuilder,
value: field.value,
hint: hint,
disabledHint: disabledHint,
onChanged: field.didChange,
onMenuStateChange: onMenuStateChange,
style: style,
underline: underline,
isDense: isDense,
isExpanded: isExpanded,
focusNode: field.focusNode,
autofocus: autofocus,
enableFeedback: enableFeedback,
alignment: alignment,
buttonStyleData: buttonStyleData,
iconStyleData: iconStyleData,
dropdownStyleData: dropdownStyleData,
menuItemStyleData: menuItemStyleData,
dropdownSearchData: dropdownSearchData,
customButton: customButton,
openWithLongPress: openWithLongPress,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
),
);
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/reactive_dropdown_button2/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: reactive_dropdown_button2
description: Wrapper around dropdown_button2 to use with reactive_forms.
version: 0.0.1
version: 0.0.2
repository: https://github.com/artflutter/reactive_forms_widgets/tree/master/packages/reactive_dropdown_button2
issue_tracker: https://github.com/artflutter/reactive_forms_widgets/issues

Expand Down

0 comments on commit 7ebb59e

Please sign in to comment.