Skip to content

Commit

Permalink
Merge pull request #328 from AhmedLSayed9/remove_an_assert
Browse files Browse the repository at this point in the history
Remove an assert from updateSelectedIndex method
  • Loading branch information
AhmedLSayed9 authored Nov 28, 2024
2 parents bd0193c + 98ca508 commit 5a75ba7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/dropdown_button2/lib/src/dropdown_button2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
return;
}

assert(widget.items!
.where((DropdownItem<T> item) => item.value == _currentValue)
.length ==
1);
for (int itemIndex = 0; itemIndex < widget.items!.length; itemIndex++) {
if (widget.items![itemIndex].value == _currentValue) {
_selectedIndex = itemIndex;
Expand Down Expand Up @@ -758,7 +754,7 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
valueListenable: widget.valueListenable ??
widget.multiValueListenable ??
ValueNotifier(null),
builder: (context, multiValue, _) {
builder: (context, _, __) {
_uniqueValueAssert(
widget.items,
widget.valueListenable,
Expand Down

0 comments on commit 5a75ba7

Please sign in to comment.