searchable_dropdown icon indicating copy to clipboard operation
searchable_dropdown copied to clipboard

How to provide validation to serch box & don't show message when no item found

Open abhihasabe opened this issue 4 years ago • 5 comments

  1. How to avoid to enter special characters.

  2. If you search some think but no data found that time not getting msg No data found.

  3. How to remove space from left side (It take some padding, when we select some data), i want to remove space.

abhihasabe avatar Apr 21 '20 04:04 abhihasabe

Hello @abhihasabe ,

  1. I don't think there is an easy way to validate the entered search keyword. The closest I could think of would be to provide a keyboardType argument. For example TextInputType.number if you want only numbers.

  2. Indeed, having a message when no item is found is a missing feature. This is recorded as #33 .

  3. There has been an interesting discussion on padding in #35 . You may want to have a look at the proposed workarounds.

lcuis avatar Apr 21 '20 09:04 lcuis

Hello lcuis ,

Thank you so much for replay.

On Tue, Apr 21, 2020 at 2:50 PM lcuis [email protected] wrote:

Hello @abhihasabe https://github.com/abhihasabe ,

I don't think there is an easy way to validate the entered search keyword. The closest I could think of would be to provide a keyboardType argument. For example TextInputType.number if you want only numbers. 2.

Indeed, having a message when no item is found is a missing feature. This is recorded as #33 https://github.com/icemanbsi/searchable_dropdown/issues/33 . 3.

There has been an interesting discussion on padding in #35 https://github.com/icemanbsi/searchable_dropdown/issues/35 . You may want to have a look at the proposed workarounds.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/icemanbsi/searchable_dropdown/issues/51#issuecomment-617060667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYMQWGUD27BQX53MU2X6FLRNVQMDANCNFSM4MM7RLXA .

abhihasabe avatar Apr 21 '20 13:04 abhihasabe

Hi @abhihasabe ,

My pleasure!

lcuis avatar Apr 21 '20 13:04 lcuis

Hello Icuis,

I user below code , but i am getting error and and focus

selectedValueWidgetFn: (item) { return Container( transform: Matrix4.translationValues(-10,0,0), alignment: Alignment.centerLeft, child: (Text(item.toString()))); }, underline: Container( height: 1.0, padding: const EdgeInsets.only(right: 13.0), margin: const EdgeInsets.only(right: 13.0), decoration: BoxDecoration( border:Border(bottom: BorderSide(color: Colors.teal, width: 3.0)) ), ),

On Tue, Apr 21, 2020 at 6:55 PM lcuis [email protected] wrote:

Hi @abhihasabe https://github.com/abhihasabe ,

My pleasure!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/icemanbsi/searchable_dropdown/issues/51#issuecomment-617178043, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYMQWH6JJXBWEJ6RFCSY73RNWNFNANCNFSM4MM7RLXA .

abhihasabe avatar Apr 21 '20 13:04 abhihasabe

Hi @abhihasabe ,

Sorry, I get no error and no unreasonable behavior related to focus with the following code:

SearchableDropdown.single(
        items: items,
        value: selectedValue,
        hint: "Select one",
        searchHint: "Select one",
        onChanged: (value) {
          setState(() {
            selectedValue = value;
          });
        },
        isExpanded: true,
        selectedValueWidgetFn: (item) {
          return Container(
              transform: Matrix4.translationValues(-10,0,0),
              alignment: Alignment.centerLeft,
              child: (Text(item.toString())));
        },
        underline: Container(
          height: 1.0,
          padding: const EdgeInsets.only(right: 13.0),
          margin: const EdgeInsets.only(right: 13.0),
          decoration: BoxDecoration(
              border:Border(bottom: BorderSide(color: Colors.teal, width: 3.0))
          ),
        ),
      )

Can you please explain what you mean by error and focus?

lcuis avatar Apr 21 '20 14:04 lcuis