Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
umeng_common_flutter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
flutter-plugin
umeng_common_flutter
Commits
9ba58020
You need to sign in or sign up before continuing.
Commit
9ba58020
authored
Oct 15, 2021
by
汪林玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加null-safety,和引入说明
parent
b452f696
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
40 deletions
+27
-40
.vscode/settings.json
.vscode/settings.json
+0
-3
LICENSE
LICENSE
+0
-1
README.md
README.md
+9
-0
lib/umeng_common_sdk.dart
lib/umeng_common_sdk.dart
+17
-17
pubspec.yaml
pubspec.yaml
+1
-1
test/umeng_common_sdk_test.dart
test/umeng_common_sdk_test.dart
+0
-18
No files found.
.vscode/settings.json
deleted
100644 → 0
View file @
b452f696
{
"dart.flutterSdkPath"
:
"/Users/qiaomeng/flutter_2.2.2"
,
}
\ No newline at end of file
LICENSE
deleted
100644 → 0
View file @
b452f696
Add your license here.
README.md
View file @
9ba58020
...
@@ -42,4 +42,13 @@ await UmengCommonSdk.onEvent(
...
@@ -42,4 +42,13 @@ await UmengCommonSdk.onEvent(
'key1': '测试上传数据',
'key1': '测试上传数据',
},
},
);
);
```
### 引入说明
```
umeng_common_sdk:
git:
url: 'git@git.xiaomanxiong.com:flutter-plugin/umeng_common_flutter.git'
ref: 'null-safety'
```
```
\ No newline at end of file
lib/umeng_common_sdk.dart
View file @
9ba58020
...
@@ -12,12 +12,12 @@ class UmengCommonSdk {
...
@@ -12,12 +12,12 @@ class UmengCommonSdk {
/// [channel] app的渠道,如:应用宝、小米、华为应用商店等
/// [channel] app的渠道,如:应用宝、小米、华为应用商店等
/// [enableLog] 是否启用日志
/// [enableLog] 是否启用日志
///
///
static
Future
<
bool
>
preInit
({
static
Future
<
bool
?
>
preInit
({
@
required
String
appKey
,
required
String
appKey
,
@
required
String
channel
,
required
String
channel
,
bool
enableLog
=
false
,
bool
enableLog
=
false
,
})
async
{
})
async
{
final
bool
result
=
await
_channel
.
invokeMethod
(
'preInit'
,
{
final
bool
?
result
=
await
_channel
.
invokeMethod
(
'preInit'
,
{
'appKey'
:
appKey
,
'appKey'
:
appKey
,
'channel'
:
channel
,
'channel'
:
channel
,
'enableLog'
:
enableLog
,
'enableLog'
:
enableLog
,
...
@@ -34,11 +34,11 @@ class UmengCommonSdk {
...
@@ -34,11 +34,11 @@ class UmengCommonSdk {
/// [mode] 页面采集模式,true:自动采集 false:手动采集
/// [mode] 页面采集模式,true:自动采集 false:手动采集
/// [process] 是否支持子进程采集数据, true:支持 false:不支持
/// [process] 是否支持子进程采集数据, true:支持 false:不支持
///
///
static
Future
<
bool
>
init
({
static
Future
<
bool
?
>
init
({
@
required
String
appKey
,
required
String
appKey
,
@
required
String
channel
,
required
String
channel
,
int
deviceType
=
1
,
int
deviceType
=
1
,
String
pushSecret
,
String
?
pushSecret
,
bool
mode
=
true
,
bool
mode
=
true
,
bool
process
=
true
,
bool
process
=
true
,
})
async
{
})
async
{
...
@@ -58,9 +58,9 @@ class UmengCommonSdk {
...
@@ -58,9 +58,9 @@ class UmengCommonSdk {
/// [event] 事件标志
/// [event] 事件标志
/// [properties] 事件参数
/// [properties] 事件参数
///
///
static
Future
<
bool
>
onEvent
({
static
Future
<
bool
?
>
onEvent
({
@
required
String
event
,
required
String
event
,
@
required
Map
<
String
,
dynamic
>
properties
,
required
Map
<
String
,
dynamic
>
properties
,
})
async
{
})
async
{
return
await
_channel
.
invokeMethod
(
'onEvent'
,
{
return
await
_channel
.
invokeMethod
(
'onEvent'
,
{
'eventId'
:
event
,
'eventId'
:
event
,
...
@@ -73,9 +73,9 @@ class UmengCommonSdk {
...
@@ -73,9 +73,9 @@ class UmengCommonSdk {
/// [userId] 用户标识
/// [userId] 用户标识
/// [provider] 账号来源。如果用户通过第三方账号登陆,微博,微信等
/// [provider] 账号来源。如果用户通过第三方账号登陆,微博,微信等
///
///
static
Future
<
bool
>
onSignIn
({
static
Future
<
bool
?
>
onSignIn
({
@
required
String
userId
,
required
String
userId
,
String
provider
,
String
?
provider
,
})
async
{
})
async
{
return
await
_channel
.
invokeMethod
(
'onSignIn'
,
{
return
await
_channel
.
invokeMethod
(
'onSignIn'
,
{
'userId'
:
userId
,
'userId'
:
userId
,
...
@@ -86,7 +86,7 @@ class UmengCommonSdk {
...
@@ -86,7 +86,7 @@ class UmengCommonSdk {
///
///
/// 账号统计-退出登陆
/// 账号统计-退出登陆
///
///
static
Future
<
bool
>
onSignOff
()
async
{
static
Future
<
bool
?
>
onSignOff
()
async
{
return
await
_channel
.
invokeMethod
(
'onSignOff'
);
return
await
_channel
.
invokeMethod
(
'onSignOff'
);
}
}
...
@@ -94,7 +94,7 @@ class UmengCommonSdk {
...
@@ -94,7 +94,7 @@ class UmengCommonSdk {
/// 页面采集-打开
/// 页面采集-打开
/// [pageName] 采集页面的名称
/// [pageName] 采集页面的名称
///
///
static
Future
<
bool
>
onPageStart
({
@
required
String
pageName
})
async
{
static
Future
<
bool
?>
onPageStart
({
required
String
pageName
})
async
{
return
await
_channel
.
invokeMethod
(
'onPageStart'
,
{
'pageName'
:
pageName
});
return
await
_channel
.
invokeMethod
(
'onPageStart'
,
{
'pageName'
:
pageName
});
}
}
...
@@ -102,7 +102,7 @@ class UmengCommonSdk {
...
@@ -102,7 +102,7 @@ class UmengCommonSdk {
/// 页面采集关闭
/// 页面采集关闭
/// [pageName] 采集页面的名称
/// [pageName] 采集页面的名称
///
///
static
Future
<
bool
>
onPageEnd
({
@
required
String
pageName
})
async
{
static
Future
<
bool
?>
onPageEnd
({
required
String
pageName
})
async
{
return
await
_channel
.
invokeMethod
(
'onPageEnd'
,
{
'pageName'
:
pageName
});
return
await
_channel
.
invokeMethod
(
'onPageEnd'
,
{
'pageName'
:
pageName
});
}
}
}
}
pubspec.yaml
View file @
9ba58020
...
@@ -4,7 +4,7 @@ version: 1.2.2
...
@@ -4,7 +4,7 @@ version: 1.2.2
homepage
:
https://www.umeng.com
homepage
:
https://www.umeng.com
environment
:
environment
:
sdk
:
'
>=2.
7
.0
<3.0.0'
sdk
:
'
>=2.
12
.0
<3.0.0'
flutter
:
"
>=1.10.0"
flutter
:
"
>=1.10.0"
dependencies
:
dependencies
:
...
...
test/umeng_common_sdk_test.dart
deleted
100644 → 0
View file @
b452f696
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
const
MethodChannel
channel
=
MethodChannel
(
'umeng_common_sdk'
);
TestWidgetsFlutterBinding
.
ensureInitialized
();
setUp
(()
{
channel
.
setMockMethodCallHandler
((
MethodCall
methodCall
)
async
{
return
'42'
;
});
});
tearDown
(()
{
channel
.
setMockMethodCallHandler
(
null
);
});
}
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