mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-04 23:11:29 +03:00
code enhancement
Signed-off-by: Hamidi Mohammed <mr.hammiddi@gmail.com>
This commit is contained in:
@@ -100,8 +100,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
final url = _updateUrl + '.apk';
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
await launchUrl(Uri.parse(url));
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -126,7 +126,7 @@ class _RemotePageState extends State<RemotePage> {
|
||||
common < oldValue.length &&
|
||||
common < newValue.length &&
|
||||
newValue[common] == oldValue[common];
|
||||
++common);
|
||||
++common) {}
|
||||
for (i = 0; i < oldValue.length - common; ++i) {
|
||||
FFI.inputKey('VK_BACK');
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ class _SettingsState extends State<SettingsPage> {
|
||||
tiles: [
|
||||
SettingsTile.navigation(
|
||||
onPressed: (context) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
await launchUrl(Uri.parse(url));
|
||||
}
|
||||
},
|
||||
title: Text(translate("Version: ") + version),
|
||||
@@ -105,8 +105,8 @@ void showAbout() {
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
const url = 'https://rustdesk.com/';
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
await launchUrl(Uri.parse(url));
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
@@ -149,7 +149,7 @@ fetch('http://localhost:21114/api/login', {
|
||||
'uuid': FFI.getByName('uuid')
|
||||
};
|
||||
try {
|
||||
final response = await http.post(Uri.parse('${url}/api/login'),
|
||||
final response = await http.post(Uri.parse('$url/api/login'),
|
||||
headers: {"Content-Type": "application/json"}, body: json.encode(body));
|
||||
return parseResp(response.body);
|
||||
} catch (e) {
|
||||
@@ -186,7 +186,7 @@ void refreshCurrentUser() async {
|
||||
'uuid': FFI.getByName('uuid')
|
||||
};
|
||||
try {
|
||||
final response = await http.post(Uri.parse('${url}/api/currentUser'),
|
||||
final response = await http.post(Uri.parse('$url/api/currentUser'),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer $token"
|
||||
@@ -212,7 +212,7 @@ void logout() async {
|
||||
'uuid': FFI.getByName('uuid')
|
||||
};
|
||||
try {
|
||||
await http.post(Uri.parse('${url}/api/logout'),
|
||||
await http.post(Uri.parse('$url/api/logout'),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer $token"
|
||||
@@ -242,7 +242,7 @@ String getUrl() {
|
||||
url = 'http://${tmp[0]}:$port';
|
||||
}
|
||||
} else {
|
||||
url = 'http://${url}:21114';
|
||||
url = 'http://$url:21114';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user