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 17:17:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-03-19 17:17:12 +0800
Commit
1bbe885a8157af8c0f482a0787427ffe29b9580d
1bbe885a
1 parent
9688afc4
feat: add device info and app version
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletions
lib/auto_track/config/manager.dart
lib/auto_track/config/queue.dart
pubspec.yaml
lib/auto_track/config/manager.dart
View file @
1bbe885
import
'package:auto_track/auto_track/config/queue.dart'
;
import
'package:device_info_plus/device_info_plus.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:package_info_plus/package_info_plus.dart'
;
import
'config.dart'
;
class
AutoTrackConfigManager
{
static
final
AutoTrackConfigManager
instance
=
AutoTrackConfigManager
.
_
();
AutoTrackConfigManager
.
_
();
AutoTrackConfigManager
.
_
()
{
PackageInfo
.
fromPlatform
().
then
((
value
)
=>
_appVersion
=
value
.
version
);
DeviceInfoPlugin
().
deviceInfo
.
then
((
value
)
=>
_deviceInfo
=
value
.
data
);
}
String
_appVersion
=
''
;
String
get
appVersion
=>
_appVersion
;
Map
<
String
,
dynamic
>
_deviceInfo
=
{};
Map
<
String
,
dynamic
>
get
deviceInfo
=>
_deviceInfo
;
AutoTrackConfig
_config
=
AutoTrackConfig
();
AutoTrackConfig
get
config
=>
_config
;
...
...
lib/auto_track/config/queue.dart
View file @
1bbe885
...
...
@@ -48,6 +48,8 @@ class AutoTrackQueue {
'user_id'
:
config
.
userId
??
''
,
'track_id'
:
config
.
trackId
??
''
,
'data_list'
:
uploadList
.
map
((
e
)
=>
e
.
toMap
()).
toList
(),
'app_version'
:
AutoTrackConfigManager
.
instance
.
appVersion
,
'device_info'
:
AutoTrackConfigManager
.
instance
.
deviceInfo
}).
onError
((
error
,
stackTrace
)
{
AutoTrackLogger
.
getInstance
().
error
(
error
!);
return
Future
.
value
(
Response
(
statusCode:
500
,
requestOptions:
RequestOptions
(
path:
host
)));
...
...
pubspec.yaml
View file @
1bbe885
...
...
@@ -9,9 +9,11 @@ environment:
dependencies
:
crypto
:
^3.0.3
device_info_plus
:
^9.1.2
dio
:
^5.4.1
flutter
:
sdk
:
flutter
package_info_plus
:
^5.0.1
plugin_platform_interface
:
^2.0.2
uuid
:
^4.3.3
...
...
Please
register
or
login
to post a comment