Skip to content

Commit 077eb6d

Browse files
authored
Merge pull request #344 from AhmedLSayed9/fix_error_style
Fix errorStyle has no effect for DropdownButtonFormField2
2 parents 2667ae6 + ac2c248 commit 077eb6d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

packages/dropdown_button2/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## UNRELEASED
2+
3+
- Fix errorStyle has no effect for DropdownButtonFormField2, closes #327.
4+
15
## 3.0.0-beta.21
26

37
- Fix menu limits when using searchable dropdown with separators, closes #214.

packages/dropdown_button2/lib/src/dropdown_button2.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
10171017
error: effectiveDecoration.error,
10181018
errorText:
10191019
field.errorText ?? effectiveDecoration.errorText,
1020+
errorStyle: effectiveDecoration.errorStyle,
10201021
//helper: effectiveDecoration.helper,
10211022
helperText: effectiveDecoration.helperText,
10221023
),
@@ -1057,6 +1058,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
10571058
.updateSurroundingElements(
10581059
error: null,
10591060
errorText: null,
1061+
errorStyle: null,
10601062
//helper: null,
10611063
helperText: null,
10621064
)

packages/dropdown_button2/lib/src/utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ extension _InputDecorationExtension on InputDecoration {
4040
InputDecoration updateSurroundingElements({
4141
required Widget? error,
4242
required String? errorText,
43+
required TextStyle? errorStyle,
4344
// TODO(Ahmed): Add this when it's supported by the min version of the package [Flutter>=3.22.0].
45+
// required Widget? helper,
4446
required String? helperText,
4547
}) {
4648
return InputDecoration(

0 commit comments

Comments
 (0)