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-03-19 15:41:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-03-19 15:41:10 +0800
Commit
9688afc4fd9d952b1a4d337eb29f902815dc4d58
9688afc4
1 parent
b16519bc
feat: upload data add key param
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
lib/auto_track/track/track.dart
lib/auto_track/utils/track_model.dart
lib/auto_track/track/track.dart
View file @
9688afc
...
...
@@ -77,22 +77,22 @@ class Track {
class
_TrackPlugin
{
static
void
pageView
(
Map
<
String
,
dynamic
>
params
)
{
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'page_view'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
));
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'page_view'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
,
params
[
'page_manual_key'
]
));
}
static
void
pageLeave
(
Map
<
String
,
dynamic
>
params
)
{
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'page_leave'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
));
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'page_leave'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
,
params
[
'page_manual_key'
]
));
}
static
void
click
(
Map
<
String
,
dynamic
>
params
)
{
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'click'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
));
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'click'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
,
params
[
'element_manual_key'
]
));
}
static
void
customEvent
(
String
type
,
Map
<
String
,
dynamic
>
params
)
{
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
type
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
));
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
type
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
,
params
[
'key'
]
??
type
));
}
static
void
scroll
(
Map
<
String
,
dynamic
>
params
)
{
AutoTrackQueue
.
instance
.
appendQueue
(
TrackModel
(
'scroll'
,
DateTime
.
now
().
millisecondsSinceEpoch
,
params
));
//
AutoTrackQueue.instance.appendQueue(TrackModel('scroll', DateTime.now().millisecondsSinceEpoch, params));
}
}
...
...
lib/auto_track/utils/track_model.dart
View file @
9688afc
class
TrackModel
{
final
String
type
;
final
int
time
;
final
String
key
;
final
Map
<
String
,
dynamic
>
params
;
TrackModel
(
this
.
type
,
this
.
time
,
this
.
params
);
TrackModel
(
this
.
type
,
this
.
time
,
this
.
params
,
this
.
key
);
Map
<
String
,
dynamic
>
toMap
()
{
return
{
'type'
:
type
,
'key'
:
key
,
'time'
:
time
,
'params'
:
params
,
};
...
...
Please
register
or
login
to post a comment