searchable_dropdown icon indicating copy to clipboard operation
searchable_dropdown copied to clipboard

onDismissed should also be called when clicked outside the box

Open homide opened this issue 2 years ago • 4 comments

So when I was using the library, I came up with this error that when we are dismissing the modalBottomSheet or dialog or menu, the onDismissed function is not called at that time.

onDismissed function is called when we select an item from the list but not when we click outside the dialog box to close the dialog or modal bottom sheet.

So if you can work and make something like onPopupDismissed, it will help in many use cases.

homide avatar Jul 14 '22 18:07 homide

+1

humam-alBasha avatar Jul 21 '22 13:07 humam-alBasha

There was a functional onPopupDismissed on 2.0.1, migrated to 5.0.2 and now it is gone. Any new changes that replaced this deprecated function?

MaxiStefan avatar Jul 27 '22 14:07 MaxiStefan

@MaxiStefan now there is a onDismissed function call inside popupProps. So when you use a module such as dialog or modalBottomSheet, there is a method as onDismissed. You can use that as shown below:

popupProps: PopupPropsMultiSelection.modalBottomSheet( onDismissed: () => print('Dismissed'), isFilterOnline: false, showSearchBox: true, textStyle: TextStyle( color: Colors.grey, fontSize: 13 ), searchFieldProps: TextFieldProps( decoration: InputDecoration( prefixIcon: Icon(Icons.search), hintText: "Search Here”, border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black, width: 1.0), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.black, width: 1.0), ), ), ), itemBuilder: _customPopupItemBuilderExample2, ),

homide avatar Jul 27 '22 14:07 homide

Will look into it, cheers

MaxiStefan avatar Jul 27 '22 14:07 MaxiStefan

@homide we fixed the issue if the user dismiss the popup by clicking outside the popup. it will be available in the next version which will be released today

salim-lachdhaf avatar Sep 22 '22 15:09 salim-lachdhaf