Skip to content

Commit 5a75ba7

Browse files
authored
Merge pull request #328 from AhmedLSayed9/remove_an_assert
Remove an assert from updateSelectedIndex method
2 parents bd0193c + 98ca508 commit 5a75ba7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/dropdown_button2/lib/src/dropdown_button2.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,6 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
511511
return;
512512
}
513513

514-
assert(widget.items!
515-
.where((DropdownItem<T> item) => item.value == _currentValue)
516-
.length ==
517-
1);
518514
for (int itemIndex = 0; itemIndex < widget.items!.length; itemIndex++) {
519515
if (widget.items![itemIndex].value == _currentValue) {
520516
_selectedIndex = itemIndex;
@@ -758,7 +754,7 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
758754
valueListenable: widget.valueListenable ??
759755
widget.multiValueListenable ??
760756
ValueNotifier(null),
761-
builder: (context, multiValue, _) {
757+
builder: (context, _, __) {
762758
_uniqueValueAssert(
763759
widget.items,
764760
widget.valueListenable,

0 commit comments

Comments
 (0)