salim-lachdhaf / searchable_dropdown

Simple and robust Dropdown with item search feature, making it possible to use an offline item list or filtering URL for easy customization.
MIT License
326 stars 316 forks source link

Padding not working when i use PopupProps.modalBottomSheet #649

Open mantsap89 opened 1 week ago

mantsap89 commented 1 week ago

Hello,

i use PopupProps.modalBottomSheet as popupProps and i am trying to add padding on the whole modal. I add the ModalBottomSheetProps object with padding but nothing is changing. Bellow you can see my code.

Thanks you in advance.

DropdownSearch<MedicalSpecialization>(
      items: doctorSelectionScreenController.medicalSpecializationsList,
      itemAsString: (MedicalSpecialization u) => u.description,
      popupProps: PopupProps.modalBottomSheet(     
          showSearchBox: true,
          searchFieldProps: TextFieldProps(
            decoration: InputDecoration(
              label: const Text(
                AppConstants.search,
                style: TextStyle(
                    fontSize: 14,
                    fontWeight: FontWeight.w300,
                    color: MyColors.blueDark),
              ),
              enabledBorder: OutlineInputBorder(
                borderSide:
                    const BorderSide(width: 1, color: MyColors.blueDark),
                borderRadius: BorderRadius.circular(10.0),
              ),
              contentPadding: const EdgeInsets.all(10),
              filled: true,
              fillColor: Colors.white.withOpacity(0.75),
            ),
          ),
          title: const Text(
            AppConstants.selectSpecialization,
            style: TextStyle(
                fontSize: 15,
                color: MyColors.blueDark,
                fontWeight: FontWeight.w500),
          ),
          itemBuilder: (ctx, item, isSelected) {
            return Text(
              item.description!,
              style: const TextStyle(fontSize: 15, color: MyColors.blueDark),
            );
          },
          modalBottomSheetProps: const ModalBottomSheetProps(
            padding: EdgeInsets.all(20),
          ),
        ),
      dropdownButtonProps: DropdownButtonProps(
        icon: SvgPicture.asset(
          "assets/images/arrow-down.svg",
          width: 14,
        ),
      ),
      dropdownDecoratorProps: DropDownDecoratorProps(
        baseStyle: const TextStyle(
            color: MyColors.blueForFieldIcons,
            fontSize: 14,
            fontWeight: FontWeight.w700),
        dropdownSearchDecoration: InputDecoration(
          label: const Text(
            AppConstants.selectSpecialization,
            style: TextStyle(
                fontSize: 14,
                fontWeight: FontWeight.w300,
                color: MyColors.blueDark),
          ),
          enabledBorder: OutlineInputBorder(
            borderSide: const BorderSide(width: 1, color: MyColors.blueDark),
            borderRadius: BorderRadius.circular(10.0),
          ),
          contentPadding: const EdgeInsets.all(20),
          filled: true,
          fillColor: Colors.white,
        ),
      ),
      onChanged: print,
    );