mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 23:19:02 +08:00
remove spaces only if number
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
c00d4c1a7b
commit
1ad740800b
@ -265,20 +265,21 @@ class _ConnectionPageState extends State<ConnectionPage>
|
||||
return [emptyPeer];
|
||||
}
|
||||
else {
|
||||
if (textEditingValue.text.contains(" ")) {
|
||||
textEditingValue = TextEditingValue(
|
||||
text: textEditingValue.text.replaceAll(" ", ""),
|
||||
selection: textEditingValue.selection,
|
||||
);
|
||||
}
|
||||
String textWithoutSpaces = textEditingValue.text.replaceAll(" ", "");
|
||||
if (int.tryParse(textWithoutSpaces) != null) {
|
||||
textEditingValue = TextEditingValue(
|
||||
text: textWithoutSpaces,
|
||||
selection: textEditingValue.selection,
|
||||
);
|
||||
}
|
||||
|
||||
return peers.where((peer) =>
|
||||
peer.id.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.username.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.hostname.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.alias.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.platform.toLowerCase().contains(textEditingValue.text.toLowerCase()))
|
||||
.toList();
|
||||
return peers.where((peer) =>
|
||||
peer.id.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.username.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.hostname.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.alias.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
||||
peer.platform.toLowerCase().contains(textEditingValue.text.toLowerCase()))
|
||||
.toList();
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user