Skip to content

Commit

Permalink
add getter to popup state
Browse files Browse the repository at this point in the history
  • Loading branch information
Salim Lachdhaf committed Feb 26, 2023
1 parent f66ce1c commit d226875
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dropdown_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class DropdownSearchState<T> extends State<DropdownSearch<T>> {
void changeSelectedItems(List<T> selectedItems) => _handleOnChangeSelectedItems(selectedItems);

///function to remove an item from the list
///Useful i multiSelection mode to delete an item
///Useful in multiSelection mode to delete an item
void removeItem(T itemToRemove) =>
_handleOnChangeSelectedItems(getSelectedItems..removeWhere((i) => _isEqual(itemToRemove, i)));

Expand Down Expand Up @@ -771,6 +771,9 @@ class DropdownSearchState<T> extends State<DropdownSearch<T>> {
///otherwise you can you [_selectSearchMode]
void openDropDownSearch() => _selectSearchMode();

///return the state of the popup
SelectionWidgetState<T>? get getPopupState => _popupStateKey.currentState;

///close dropdownSearch popup if it's open
void closeDropDownSearch() => _popupStateKey.currentState?.closePopup();

Expand Down

0 comments on commit d226875

Please sign in to comment.