Skip to content

Conversation

MohammedShuqair
Copy link

add a fitted box option for small input fields

@MohammedShuqair MohammedShuqair changed the title dd a fitted box option Add a fitted box option Dec 8, 2024
super.onSaved,
super.validator,
super.decoratorProps,
super.onTap,
Copy link
Owner

@salim-lachdhaf salim-lachdhaf Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not understand why you added onTap CallBack ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for a callback that is executed when the DropdownSearch is pressed, later I discovered onBeforePopupOpening so I no longer use onTap and removed it.
The reason I search for onBeforePopupOpening might be useful, I had this case:

  1. Auth Screen with CustomTextFormField (name, email etc) and DropdownSearch for country selection.
  2. Having Focus on a CustomTextFormField (keyboard shown) 👍
  3. Taping on DropdownSearch (keyboard disappeared) 👍
  4. Selecting Item From DropdownSearchPopup, popup closed 👍
  5. Focus return to last CustomTextFormField and (keyboard shown) 👎

fix:
add focusNode property for each CustomTextFormField and updating the code

Old:

  onTapOutside: (pointDown) {
              FocusScope.of(context).unfocus();
            },

New:

 onTapOutside: (pointDown) {
              focusNode!.unfocus();
            },

After all, I neither use onTap nor onBeforePopupOpening 😄

This commit primarily focuses on improving the code formatting in `lib/src/base_dropdown_search.dart`.

Specific changes include:
- Adding trailing commas to multi-line parameter lists and typedefs.
- Ensuring consistent newlines and spacing.
- Reformatting conditional expressions for better clarity.
- Adjusting the `fit` property of `FittedBox` to `scaleDown` for selected item display.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants