searchable_dropdown
searchable_dropdown copied to clipboard
Searchbox Padding
Hello,
I'm using the version : dropdown_search: ^5.0.3. The top padding is to large. It's look like an issue. How can I manage it ?
Thanks

in which mode ?
In this mode : PopupPropsMultiSelection.modalBottomSheet
use .bottomSheet
or try to update your Flutter SDK (the issue seems corrected with the last SDK).
if you are not using MultiSelection mode use PopupProps
istead of PopupPropsMultiSelection
Thanks for the quick response. Flutter has been updated. It works for Android but not for iOS.
-
iOS :
-
Android :
please past a simple example to analyse the issue
Here is the code :
Widget _customPopupItemBuilderSubActivity(
BuildContext context,
SubActivityModel? item,
bool isSelected,
) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: !isSelected
? null
: BoxDecoration(
border: Border.all(color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(5),
color: Colors.white,
),
child: ListTile(
selected: isSelected,
title: Text(item?.name ?? ''),
),
);
}
DropdownSearch<SubActivityModel>(
key: _formKey,
onChanged: (value) {
if (value != null) {
print(value.name);
setState(() {
personalInformationData!['domainActivity'] =
value.code as String;
personalInformationValidation['domainActivity'] = false;
});
}
},
asyncItems: (String? filter) async {
return await _subActivities;
},
popupProps: PopupPropsMultiSelection.bottomSheet(
showSelectedItems: true,
itemBuilder: _customPopupItemBuilderSubActivity,
showSearchBox: true,
),
compareFn: (item, sItem) {
return item.name == sItem.name;
},
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
labelText: 'Activité *',
errorText: personalInformationValidation['domainActivity']
as bool
? RegisterPersonnalDataValidator.domainActivity(
personalInformationData!['domainActivity'] as String)
: null,
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.only(left: 0, top: 13, bottom: 15),
),
),
),
I've got same issue can anyone solved this?
Facing the same issue, any update on this?
I thaught it might be the container, but it's something else.
popupProps: PopupProps.modalBottomSheet(
containerBuilder: (context, popupWidget) {
return Container(
color: Colors.redAccent,
child: popupWidget,
);
},
),
I did some tests and the problem seems to be related to the margin applied to the ModalBottomSheet container:
return Container(
margin: EdgeInsets.only(
bottom: viewInsetsBottom,
top: viewPaddingTop,
),
child: _popupWidgetInstance(),
);
The widget is displayed correctly by removing the margin.