Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
auto_track_plugin
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Dubhe
2024-04-29 10:52:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-04-29 10:52:35 +0800
Commit
932649b90e617dcdef0510ea79ee608269c2e949
932649b9
1 parent
c2cacb41
feat: add uploadInterval config
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
5 deletions
lib/auto_track/config/config.dart
lib/auto_track/config/manager.dart
lib/auto_track/config/queue.dart
lib/auto_track/drag/drag_info.dart
lib/auto_track/drag/drag_pointer_event_listener.dart
lib/auto_track/config/config.dart
View file @
932649b
...
...
@@ -22,7 +22,8 @@ class AutoTrackConfig {
this
.
enableClick
=
true
,
this
.
enableUpload
=
false
,
this
.
enableDrag
=
false
,
this
.
enableIgnoreNullKey
=
false
this
.
enableIgnoreNullKey
=
false
,
this
.
uploadInterval
})
{
trackId
??=
const
Uuid
().
v4
().
replaceAll
(
'-'
,
''
);
signature
??=
(
t
)
=>
sha256
.
convert
(
utf8
.
encode
(
'
$appKey$t$appSecret
'
)).
toString
();
...
...
@@ -35,6 +36,8 @@ class AutoTrackConfig {
String
?
userId
;
String
?
uniqueId
;
int
?
uploadInterval
;
Function
?
signature
;
List
<
AutoTrackPageConfig
>
pageConfigs
;
...
...
lib/auto_track/config/manager.dart
View file @
932649b
...
...
@@ -41,6 +41,8 @@ class AutoTrackConfigManager {
_deviceId
=
md5
.
convert
(
utf8
.
encode
(
'
${(_baseDeviceInfo as IosDeviceInfo).identifierForVendor}
#
${config.appKey}
'
)).
toString
();
}
else
if
(
_baseDeviceInfo
is
AndroidDeviceInfo
)
{
_deviceId
=
md5
.
convert
(
utf8
.
encode
(
'
${(_baseDeviceInfo as AndroidDeviceInfo).serialNumber}
#
${config.appKey}
'
)).
toString
();
}
else
if
(
_baseDeviceInfo
is
MacOsDeviceInfo
)
{
_deviceId
=
'
${(_baseDeviceInfo as MacOsDeviceInfo).hostName}
-
${(_baseDeviceInfo as MacOsDeviceInfo).computerName}
'
;
}
else
{
_deviceId
=
''
;
}
...
...
lib/auto_track/config/queue.dart
View file @
932649b
...
...
@@ -23,7 +23,7 @@ class AutoTrackQueue {
void
start
()
{
if
(
_timer
!=
null
)
return
;
_timer
=
Timer
.
periodic
(
const
Duration
(
seconds:
10
),
(
timer
)
{
_timer
=
Timer
.
periodic
(
Duration
(
seconds:
AutoTrackConfigManager
.
instance
.
config
.
uploadInterval
??
10
),
(
timer
)
{
flush
();
});
}
...
...
lib/auto_track/drag/drag_info.dart
View file @
932649b
...
...
@@ -16,8 +16,7 @@ class DragInfo {
dragInfo
.
_beginOffset
=
begin
;
dragInfo
.
_endOffset
=
end
;
dragInfo
.
_duration
=
duration
;
dragInfo
.
_ignore
=
AutoTrackConfigManager
.
instance
.
isIgnoreElement
(
pageElement
.
widget
.
key
??
ValueKey
(
pageInfo
.
pageManualKey
));
dragInfo
.
_ignore
=
pageInfo
.
ignore
;
double
dx
=
dragInfo
.
endOffset
.
dx
-
dragInfo
.
beginOffset
.
dx
;
double
dy
=
dragInfo
.
endOffset
.
dy
-
dragInfo
.
beginOffset
.
dy
;
...
...
lib/auto_track/drag/drag_pointer_event_listener.dart
View file @
932649b
...
...
@@ -51,7 +51,7 @@ class _AutoTrackPanGestureRecognizer extends PanGestureRecognizer {
if
(
beginEvent
!=
null
)
{
final
distance
=
(
beginEvent
!.
position
.
dx
-
event
.
position
.
dx
).
abs
()
+
(
beginEvent
!.
position
.
dy
-
event
.
position
.
dy
).
abs
();
if
(
distance
>
3
0
)
{
if
(
distance
>
5
0
)
{
final
info
=
DragInfo
.
from
(
begin:
beginEvent
!.
position
,
end:
event
.
position
,
...
...
Please
register
or
login
to post a comment