mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
update idController when create new connection
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -35,6 +35,11 @@ class IDTextInputFormatter extends TextInputFormatter {
|
||||
|
||||
String formatID(String id) {
|
||||
String id2 = id.replaceAll(' ', '');
|
||||
String suffix = '';
|
||||
if (id2.endsWith(r'\r') || id2.endsWith(r'/r')) {
|
||||
suffix = id2.substring(id2.length - 2, id2.length);
|
||||
id2 = id2.substring(0, id2.length - 2);
|
||||
}
|
||||
if (int.tryParse(id2) == null) return id;
|
||||
String newID = '';
|
||||
if (id2.length <= 3) {
|
||||
@@ -47,7 +52,7 @@ String formatID(String id) {
|
||||
newID += " ${id2.substring(i, i + 3)}";
|
||||
}
|
||||
}
|
||||
return newID;
|
||||
return newID + suffix;
|
||||
}
|
||||
|
||||
String trimID(String id) {
|
||||
|
||||
Reference in New Issue
Block a user