flutter_chips_input
flutter_chips_input copied to clipboard
When Press Any Key in keyboard then not working properly ,also Backspace key not working in some Device Like vivo, Samsung
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...!
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.
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 ...!
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?
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.
I created a solution for this and some other problems - see https://github.com/danvick/flutter_chips_input/issues/104
@jozes can you make a PR into this repo?