reduce toLowerCase
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
05c789ae50
commit
cfc0925e75
@ -258,6 +258,7 @@ class _ConnectionPageState extends State<ConnectionPage>
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String textWithoutSpaces = textEditingValue.text.replaceAll(" ", "");
|
String textWithoutSpaces = textEditingValue.text.replaceAll(" ", "");
|
||||||
|
String textToFind = textWithoutSpaces.toLowerCase();
|
||||||
if (int.tryParse(textWithoutSpaces) != null) {
|
if (int.tryParse(textWithoutSpaces) != null) {
|
||||||
textEditingValue = TextEditingValue(
|
textEditingValue = TextEditingValue(
|
||||||
text: textWithoutSpaces,
|
text: textWithoutSpaces,
|
||||||
@ -266,10 +267,10 @@ class _ConnectionPageState extends State<ConnectionPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
return peers.where((peer) =>
|
return peers.where((peer) =>
|
||||||
peer.id.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
peer.id.toLowerCase().contains(textToFind) ||
|
||||||
peer.username.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
peer.username.toLowerCase().contains(textToFind) ||
|
||||||
peer.hostname.toLowerCase().contains(textEditingValue.text.toLowerCase()) ||
|
peer.hostname.toLowerCase().contains(textToFind) ||
|
||||||
peer.alias.toLowerCase().contains(textEditingValue.text.toLowerCase()))
|
peer.alias.toLowerCase().contains(textToFind))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user