Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Press Any Key in keyboard then not working properly ,also Backspace key not working in some Device Like vivo, Samsung #102

Open
vijayvaghela72 opened this issue Dec 8, 2021 · 6 comments

Comments

@vijayvaghela72
Copy link

vijayvaghela72 commented Dec 8, 2021

try with many samsung device and vivo device , in all samsung device it's not working , some vivo device it's working and in some it's not working .

my code like this ,

`RawKeyboardListener(
focusNode: FocusNode(),
autofocus: true,
onKey: (RawKeyEvent event) {
if (event.isKeyPressed(LogicalKeyboardKey.backspace)) {
print("back space is pressed");

            print("${tempAttList}");
          }
        },
        child: ChipsInput(
          initialValue: initial,
          //  focusNode: FocusNode(),
          decoration: InputDecoration(
            filled: true,
            fillColor: lightWhite,
            hintText: 'Select Attributes Values',
            hintStyle: Theme.of(context).textTheme.caption,
            contentPadding:
                EdgeInsets.symmetric(horizontal: 10, vertical: 5),
            prefixIconConstraints:
                BoxConstraints(minWidth: 40, maxHeight: 20),
            focusedBorder: OutlineInputBorder(
              borderSide: BorderSide(color: fontColor),
              borderRadius: BorderRadius.circular(7.0),
            ),
            enabledBorder: UnderlineInputBorder(
              borderSide: BorderSide(color: lightWhite),
              borderRadius: BorderRadius.circular(8.0),
            ),
          ),
          findSuggestions: (String query) {
            print("query : $query ");
            // if (query.isNotEmpty) {
            //   print("query is emptly ");
            // }
            if (query.isNotEmpty) {
              print("query.length : ${query.length}");
              return attributesValueList.where((profile) {
                // print("values****$query***${profile.attributeId}****\n"
                //     "${profile.value}****${attrId[index]}***$index**$attrId");

                return (profile.value!.toLowerCase().contains(query) &&
                    (int.parse(profile.attributeId!) == attrId[index]));
              }).toList(growable: false);
            } else {
              return attributesValueList.where((profile) {
                return (int.parse(profile.attributeId!) == attrId[index]);
              }).toList(growable: false);
            }
          },
          onChanged: (List<AttributeValueModel> data) {
            //add remove
            for (int i = 0; i < data.length; i++) {
              if (!attrValId.contains(data[i].id)) {
                attrValId.add(int.parse(data[i].id!));
                attrVal.add(data[i].value!);
              }
            }
            if (!tempAttList.contains(data)) {
              //
              if (tempAttList.length >= index) {
                if (tempAttList.length > index) tempAttList.removeAt(index);
                tempAttList.insert(index, data);
              } else
                tempAttList[index] = data;
            }
          },
          chipBuilder: (BuildContext context,
              ChipsInputState<AttributeValueModel> state,
              AttributeValueModel profile) {
            return InputChip(
              key: ObjectKey(profile),
              label: Text(profile.value!),
              onDeleted: () => state.deleteChip(profile),
              // commnet by me     //   onSelected: (_) => _onChipTapped(profile),
              materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
            );
          },
          suggestionBuilder: (BuildContext context,
              ChipsInputState<AttributeValueModel> state,
              AttributeValueModel profile) {
            return ListTile(
              dense: true,
              key: ObjectKey(profile),
              title: Text(profile.value!),
              onTap: () => state.selectSuggestion(profile),
            );
          },
        ),
      ),`

Thank You...!

@vijayvaghela72 vijayvaghela72 changed the title Backspace button is not working on some Android devices (Samsung especially) When Press Any Key in keyboard then not working properly ,also Backspace key not working in some Device Like vivo, Samsung Dec 8, 2021
@jameslester2004
Copy link

jameslester2004 commented Dec 9, 2021

I can't get the example working. Wondering if this is no longer maintained?

Iphone 12 emulator keyboard is really glitchy. Can only type one character, then doesn't let me do anything.

@vijayvaghela72
Copy link
Author

yes @jameslester2004 sir

you are right.

getting same problem with android device but package team don't respond any more .

Hope they will solve soon ...!

@mark8044
Copy link

mark8044 commented Jan 4, 2022

Having the same problems. This package is otherwise awesome except that you can't easily type into the field.

Since that problem is at the core of this amazing package, that leads me to believe the package is now defunct?

Does anyone know of any good alternatives?

@jameslester2004
Copy link

I'd suggest two approaches: build your own solution, or fork the package and make it work for you / share with community.

I was on a deadline, so just built my own in the end. It isn't quite as powerful as this package would have been, but does the job for me.

@jozes
Copy link

jozes commented Jan 17, 2022

I created a solution for this and some other problems - see
#104

@novvia-dev
Copy link

@jozes can you make a PR into this repo?

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

No branches or pull requests

5 participants