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-06-13 13:45:51 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-06-13 13:45:51 +0800
Commit
09a8daa9fb5ad35dbbd705992e02a50bc118f63e
09a8daa9
1 parent
d9e68615
feat: 添加错误上报功能并引入错误模型类
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletions
lib/auto_track/track/track.dart
lib/auto_track/utils/error_model.dart
pubspec.yaml
lib/auto_track/track/track.dart
View file @
09a8daa
import
'package:auto_track/auto_track/config/queue.dart'
;
import
'package:auto_track/auto_track/drag/drag_info.dart'
;
import
'package:auto_track/auto_track/utils/error_model.dart'
;
import
'package:auto_track/auto_track/utils/track_model.dart'
;
import
'../click/click_info.dart'
;
...
...
@@ -99,6 +100,10 @@ class Track {
_TrackPlugin
.
customEvent
(
type
,
params
);
AutoTrackLogger
.
getInstance
().
debug
(
'track custom_event =>
$params
'
);
}
void
reportError
(
Object
error
,
StackTrace
stack
)
{
_TrackPlugin
.
customEvent
(
'error'
,
ErrorModel
(
error:
error
,
stack:
stack
).
toMap
());
}
}
class
_TrackPlugin
{
...
...
lib/auto_track/utils/error_model.dart
0 → 100644
View file @
09a8daa
class
ErrorModel
{
final
Object
error
;
final
StackTrace
stack
;
ErrorModel
({
required
this
.
error
,
required
this
.
stack
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
'error'
:
error
.
toString
(),
'stack'
:
stack
.
toString
(),
'key'
:
error
.
runtimeType
.
toString
()
};
}
}
...
...
pubspec.yaml
View file @
09a8daa
name
:
auto_track
description
:
"
Auto
Track
Plugin"
version
:
0.0.
3
version
:
0.0.
4
homepage
:
https://github.com/epoll-j/auto_track_plugin
environment
:
...
...
Please
register
or
login
to post a comment