Skip to content

Commit bb6996e

Browse files
authored
Merge pull request #446 from AhmedLSayed9/assert_mutually_exclusive_error_builder_and_text
Add assert for mutually exclusive errorBuilder and errorText [Flutter core]
2 parents b018ee5 + def25ce commit bb6996e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

packages/dropdown_button2/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add `forceErrorText` support for DropdownButtonFormField2 [Flutter core].
66
- Add ARIA menu roles to menu-related widgets for accessibility [Flutter core].
77
- Document `DropdownButtonFormField2.onChanged` ordering relative to `Form.onChanged` [Flutter core].
8+
- Add assert for mutually exclusive `errorBuilder` and `errorText` [Flutter core].
89
- Add `anchoredMinHeight` to keep the menu anchored to the button and shrink to fit when possible, closes #429.
910
- Re-lay out dropdown menu on ancestor scroll.
1011
- Add `barrierBlocksInteraction` to allow interaction with underlying widgets while the dropdown menu is open.

packages/dropdown_button2/lib/src/dropdown_button2.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,10 @@ class DropdownButtonFormField2<T> extends FormField<T> {
11531153
valueListenable == null || multiValueListenable == null,
11541154
'Only one of valueListenable or multiValueListenable can be used.',
11551155
),
1156+
assert(
1157+
errorBuilder == null || decoration?.errorText == null,
1158+
'Declaring both errorBuilder and decoration.errorText is not supported.',
1159+
),
11561160
decoration = decoration ?? const InputDecoration(),
11571161
super(
11581162
initialValue: valueListenable != null

0 commit comments

Comments
 (0)