Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
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
mobile
gmalpha_flutter
Commits
85b2932f
Commit
85b2932f
authored
6 years ago
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试 flutter phobos
parent
34d808e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
phobos_flutter.dart
lib/phobos/phobos_flutter.dart
+62
-0
No files found.
lib/phobos/phobos_flutter.dart
0 → 100644
View file @
85b2932f
import
'package:flutter/services.dart'
;
// flutter 埋点方案
class
PhobosFlutter
{
static
const
MethodChannel
_channel
=
const
MethodChannel
(
'phobos_flutter_plugin'
);
///
/// track
/// 灰度信息
///
/// @param GreyType 事件名.
///
/// 使用示例:
/// PhobosFlutter.getGreyType();
///
static
Future
<
String
>
get
getGreyType
async
{
return
await
_channel
.
invokeMethod
(
'getGreyType'
);
}
///当前API
static
Future
<
String
>
get
getServerAPI
async
{
return
await
_channel
.
invokeMethod
(
'getServerAPI'
);
}
/// signingType 包的类型
static
Future
<
String
>
get
getSigningType
async
{
return
await
_channel
.
invokeMethod
(
'getServerAPI'
);
}
/// userId
static
Future
<
String
>
get
getUserId
async
{
return
await
_channel
.
invokeMethod
(
'getUserId'
);
}
///
/// track
/// 事件追踪
///
/// @param eventName String 事件名.
/// @param properties Map<String,dynamic> 事件属性.
///
/// 使用示例:
/// PhobosFlutter.track('eventname',{'key1':'value1','key2':'value2'});
///
static
void
track
(
String
eventName
,
Map
<
String
,
dynamic
>
properties
)
{
assert
(
eventName
!=
null
);
List
<
dynamic
>
params
=
[
eventName
,
properties
];
_channel
.
invokeMethod
(
'track'
,
params
);
}
static
void
trackSendNow
(
String
eventName
,
Map
<
String
,
dynamic
>
properties
)
{
assert
(
eventName
!=
null
);
List
<
dynamic
>
params
=
[
eventName
,
properties
];
_channel
.
invokeMethod
(
'track'
,
params
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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