remove spaces only if number
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
c00d4c1a7b
commit
1ad740800b
@ -265,9 +265,10 @@ class _ConnectionPageState extends State<ConnectionPage>
|
|||||||
return [emptyPeer];
|
return [emptyPeer];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (textEditingValue.text.contains(" ")) {
|
String textWithoutSpaces = textEditingValue.text.replaceAll(" ", "");
|
||||||
|
if (int.tryParse(textWithoutSpaces) != null) {
|
||||||
textEditingValue = TextEditingValue(
|
textEditingValue = TextEditingValue(
|
||||||
text: textEditingValue.text.replaceAll(" ", ""),
|
text: textWithoutSpaces,
|
||||||
selection: textEditingValue.selection,
|
selection: textEditingValue.selection,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user