Skip to content

Commit

Permalink
Merge pull request #321 from AhmedLSayed9/fix_error_border_for_dropdo…
Browse files Browse the repository at this point in the history
…wnbuttonformfield

Fix error border not showing for DropdownButtonFormField2
  • Loading branch information
AhmedLSayed9 authored Oct 5, 2024
2 parents 08fd370 + 011dc7e commit 334286f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/dropdown_button2/lib/src/dropdown_button2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -986,10 +986,11 @@ class DropdownButtonFormField2<T> extends FormField<T> {
field as _DropdownButtonFormFieldState<T>;
final InputDecoration decorationArg =
_getInputDecoration(decoration, buttonStyleData);
final InputDecoration effectiveDecoration =
decorationArg.applyDefaults(
Theme.of(field.context).inputDecorationTheme,
);
final InputDecoration effectiveDecoration = decorationArg
.applyDefaults(Theme.of(field.context).inputDecorationTheme)
.copyWith(
error: field.hasError ? const SizedBox.shrink() : null,
);

final bool showSelectedItem = items != null &&
items
Expand Down

0 comments on commit 334286f

Please sign in to comment.