Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rustdesk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李朝发
rustdesk
Commits
c1906914
Unverified
Commit
c1906914
authored
Jun 20, 2022
by
RustDesk
Committed by
GitHub
Jun 20, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #818 from hammiddi/master
code enhancement
parents
086c8e43
5a051ae3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
27 deletions
+17
-27
common.dart
flutter/lib/common.dart
+2
-2
file_model.dart
flutter/lib/models/file_model.dart
+0
-8
native_model.dart
flutter/lib/models/native_model.dart
+0
-1
web_model.dart
flutter/lib/models/web_model.dart
+2
-0
connection_page.dart
flutter/lib/pages/connection_page.dart
+2
-2
remote_page.dart
flutter/lib/pages/remote_page.dart
+1
-1
settings_page.dart
flutter/lib/pages/settings_page.dart
+8
-8
gestures.dart
flutter/lib/widgets/gestures.dart
+2
-5
No files found.
flutter/lib/common.dart
View file @
c1906914
...
@@ -233,7 +233,7 @@ class AccessibilityListener extends StatelessWidget {
...
@@ -233,7 +233,7 @@ class AccessibilityListener extends StatelessWidget {
}
}
},
},
onPointerUp:
(
evt
)
{
onPointerUp:
(
evt
)
{
if
(
evt
.
size
==
1
&&
GestureBinding
.
instance
!=
null
)
{
if
(
evt
.
size
==
1
)
{
GestureBinding
.
instance
.
handlePointerEvent
(
PointerUpEvent
(
GestureBinding
.
instance
.
handlePointerEvent
(
PointerUpEvent
(
pointer:
evt
.
pointer
+
offset
,
pointer:
evt
.
pointer
+
offset
,
size:
0.1
,
size:
0.1
,
...
@@ -243,7 +243,7 @@ class AccessibilityListener extends StatelessWidget {
...
@@ -243,7 +243,7 @@ class AccessibilityListener extends StatelessWidget {
}
}
},
},
onPointerMove:
(
evt
)
{
onPointerMove:
(
evt
)
{
if
(
evt
.
size
==
1
&&
GestureBinding
.
instance
!=
null
)
{
if
(
evt
.
size
==
1
)
{
GestureBinding
.
instance
.
handlePointerEvent
(
PointerMoveEvent
(
GestureBinding
.
instance
.
handlePointerEvent
(
PointerMoveEvent
(
pointer:
evt
.
pointer
+
offset
,
pointer:
evt
.
pointer
+
offset
,
size:
0.1
,
size:
0.1
,
...
...
flutter/lib/models/file_model.dart
View file @
c1906914
...
@@ -593,15 +593,7 @@ class FileFetcher {
...
@@ -593,15 +593,7 @@ class FileFetcher {
tryCompleteTask
(
String
?
msg
,
String
?
isLocalStr
)
{
tryCompleteTask
(
String
?
msg
,
String
?
isLocalStr
)
{
if
(
msg
==
null
||
isLocalStr
==
null
)
return
;
if
(
msg
==
null
||
isLocalStr
==
null
)
return
;
late
final
isLocal
;
late
final
tasks
;
late
final
tasks
;
if
(
isLocalStr
==
"true"
)
{
isLocal
=
true
;
}
else
if
(
isLocalStr
==
"false"
)
{
isLocal
=
false
;
}
else
{
return
;
}
try
{
try
{
final
fd
=
FileDirectory
.
fromJson
(
jsonDecode
(
msg
));
final
fd
=
FileDirectory
.
fromJson
(
jsonDecode
(
msg
));
if
(
fd
.
id
>
0
)
{
if
(
fd
.
id
>
0
)
{
...
...
flutter/lib/models/native_model.dart
View file @
c1906914
...
@@ -21,7 +21,6 @@ typedef F2 = Pointer<Utf8> Function(Pointer<Utf8>, Pointer<Utf8>);
...
@@ -21,7 +21,6 @@ typedef F2 = Pointer<Utf8> Function(Pointer<Utf8>, Pointer<Utf8>);
typedef
F3
=
void
Function
(
Pointer
<
Utf8
>,
Pointer
<
Utf8
>);
typedef
F3
=
void
Function
(
Pointer
<
Utf8
>,
Pointer
<
Utf8
>);
class
PlatformFFI
{
class
PlatformFFI
{
static
Pointer
<
RgbaFrame
>?
_lastRgbaFrame
;
static
String
_dir
=
''
;
static
String
_dir
=
''
;
static
String
_homeDir
=
''
;
static
String
_homeDir
=
''
;
static
F2
?
_getByName
;
static
F2
?
_getByName
;
...
...
flutter/lib/models/web_model.dart
View file @
c1906914
// ignore_for_file: avoid_web_libraries_in_flutter
import
'dart:convert'
;
import
'dart:convert'
;
import
'dart:typed_data'
;
import
'dart:typed_data'
;
import
'dart:js'
;
import
'dart:js'
;
...
...
flutter/lib/pages/connection_page.dart
View file @
c1906914
...
@@ -100,8 +100,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
...
@@ -100,8 +100,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
:
InkWell
(
:
InkWell
(
onTap:
()
async
{
onTap:
()
async
{
final
url
=
_updateUrl
+
'.apk'
;
final
url
=
_updateUrl
+
'.apk'
;
if
(
await
canLaunch
(
url
))
{
if
(
await
canLaunch
Url
(
Uri
.
parse
(
url
)
))
{
await
launch
(
url
);
await
launch
Url
(
Uri
.
parse
(
url
)
);
}
}
},
},
child:
Container
(
child:
Container
(
...
...
flutter/lib/pages/remote_page.dart
View file @
c1906914
...
@@ -126,7 +126,7 @@ class _RemotePageState extends State<RemotePage> {
...
@@ -126,7 +126,7 @@ class _RemotePageState extends State<RemotePage> {
common
<
oldValue
.
length
&&
common
<
oldValue
.
length
&&
common
<
newValue
.
length
&&
common
<
newValue
.
length
&&
newValue
[
common
]
==
oldValue
[
common
];
newValue
[
common
]
==
oldValue
[
common
];
++
common
)
;
++
common
)
{}
for
(
i
=
0
;
i
<
oldValue
.
length
-
common
;
++
i
)
{
for
(
i
=
0
;
i
<
oldValue
.
length
-
common
;
++
i
)
{
FFI
.
inputKey
(
'VK_BACK'
);
FFI
.
inputKey
(
'VK_BACK'
);
}
}
...
...
flutter/lib/pages/settings_page.dart
View file @
c1906914
...
@@ -68,8 +68,8 @@ class _SettingsState extends State<SettingsPage> {
...
@@ -68,8 +68,8 @@ class _SettingsState extends State<SettingsPage> {
tiles:
[
tiles:
[
SettingsTile
.
navigation
(
SettingsTile
.
navigation
(
onPressed:
(
context
)
async
{
onPressed:
(
context
)
async
{
if
(
await
canLaunch
(
url
))
{
if
(
await
canLaunch
Url
(
Uri
.
parse
(
url
)
))
{
await
launch
(
url
);
await
launch
Url
(
Uri
.
parse
(
url
)
);
}
}
},
},
title:
Text
(
translate
(
"Version: "
)
+
version
),
title:
Text
(
translate
(
"Version: "
)
+
version
),
...
@@ -105,8 +105,8 @@ void showAbout() {
...
@@ -105,8 +105,8 @@ void showAbout() {
InkWell
(
InkWell
(
onTap:
()
async
{
onTap:
()
async
{
const
url
=
'https://rustdesk.com/'
;
const
url
=
'https://rustdesk.com/'
;
if
(
await
canLaunch
(
url
))
{
if
(
await
canLaunch
Url
(
Uri
.
parse
(
url
)
))
{
await
launch
(
url
);
await
launch
Url
(
Uri
.
parse
(
url
)
);
}
}
},
},
child:
Padding
(
child:
Padding
(
...
@@ -149,7 +149,7 @@ fetch('http://localhost:21114/api/login', {
...
@@ -149,7 +149,7 @@ fetch('http://localhost:21114/api/login', {
'uuid'
:
FFI
.
getByName
(
'uuid'
)
'uuid'
:
FFI
.
getByName
(
'uuid'
)
};
};
try
{
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
));
headers:
{
"Content-Type"
:
"application/json"
},
body:
json
.
encode
(
body
));
return
parseResp
(
response
.
body
);
return
parseResp
(
response
.
body
);
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -186,7 +186,7 @@ void refreshCurrentUser() async {
...
@@ -186,7 +186,7 @@ void refreshCurrentUser() async {
'uuid'
:
FFI
.
getByName
(
'uuid'
)
'uuid'
:
FFI
.
getByName
(
'uuid'
)
};
};
try
{
try
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$
{url}
/api/currentUser'
),
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$
url
/api/currentUser'
),
headers:
{
headers:
{
"Content-Type"
:
"application/json"
,
"Content-Type"
:
"application/json"
,
"Authorization"
:
"Bearer
$token
"
"Authorization"
:
"Bearer
$token
"
...
@@ -212,7 +212,7 @@ void logout() async {
...
@@ -212,7 +212,7 @@ void logout() async {
'uuid'
:
FFI
.
getByName
(
'uuid'
)
'uuid'
:
FFI
.
getByName
(
'uuid'
)
};
};
try
{
try
{
await
http
.
post
(
Uri
.
parse
(
'
$
{url}
/api/logout'
),
await
http
.
post
(
Uri
.
parse
(
'
$
url
/api/logout'
),
headers:
{
headers:
{
"Content-Type"
:
"application/json"
,
"Content-Type"
:
"application/json"
,
"Authorization"
:
"Bearer
$token
"
"Authorization"
:
"Bearer
$token
"
...
@@ -242,7 +242,7 @@ String getUrl() {
...
@@ -242,7 +242,7 @@ String getUrl() {
url
=
'http://
${tmp[0]}
:
$port
'
;
url
=
'http://
${tmp[0]}
:
$port
'
;
}
}
}
else
{
}
else
{
url
=
'http://
$
{url}
:21114'
;
url
=
'http://
$
url
:21114'
;
}
}
}
}
}
}
...
...
flutter/lib/widgets/gestures.dart
View file @
c1906914
...
@@ -594,10 +594,7 @@ class _TapTracker {
...
@@ -594,10 +594,7 @@ class _TapTracker {
required
this
.
entry
,
required
this
.
entry
,
required
Duration
doubleTapMinTime
,
required
Duration
doubleTapMinTime
,
required
this
.
gestureSettings
,
required
this
.
gestureSettings
,
})
:
assert
(
doubleTapMinTime
!=
null
),
})
:
pointer
=
event
.
pointer
,
assert
(
event
!=
null
),
assert
(
event
.
buttons
!=
null
),
pointer
=
event
.
pointer
,
_initialGlobalPosition
=
event
.
position
,
_initialGlobalPosition
=
event
.
position
,
initialButtons
=
event
.
buttons
,
initialButtons
=
event
.
buttons
,
_doubleTapMinTimeCountdown
=
_doubleTapMinTimeCountdown
=
...
@@ -643,7 +640,7 @@ class _TapTracker {
...
@@ -643,7 +640,7 @@ class _TapTracker {
/// CountdownZoned tracks whether the specified duration has elapsed since
/// CountdownZoned tracks whether the specified duration has elapsed since
/// creation, honoring [Zone].
/// creation, honoring [Zone].
class
_CountdownZoned
{
class
_CountdownZoned
{
_CountdownZoned
({
required
Duration
duration
})
:
assert
(
duration
!=
null
)
{
_CountdownZoned
({
required
Duration
duration
})
{
Timer
(
duration
,
_onTimeout
);
Timer
(
duration
,
_onTimeout
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment