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
645a1324
Commit
645a1324
authored
Sep 03, 2021
by
汪林玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
d3dbadcb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
24 deletions
+11
-24
example/pubspec.yaml
example/pubspec.yaml
+1
-1
example/test/widget_test.dart
example/test/widget_test.dart
+1
-15
lib/umeng_common_sdk.dart
lib/umeng_common_sdk.dart
+8
-7
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
example/pubspec.yaml
View file @
645a1324
...
...
@@ -6,7 +6,7 @@ description: Demonstrates how to use the umeng_common_sdk plugin.
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
environment
:
sdk
:
'
>=2.
12
.0
<3.0.0'
sdk
:
'
>=2.
7
.0
<3.0.0'
dependencies
:
flutter
:
...
...
example/test/widget_test.dart
View file @
645a1324
...
...
@@ -8,20 +8,6 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:umeng_common_sdk_example/main.dart'
;
void
main
(
)
{
testWidgets
(
'Verify Platform version'
,
(
WidgetTester
tester
)
async
{
// Build our app and trigger a frame.
await
tester
.
pumpWidget
(
MyApp
());
// Verify that platform version is retrieved.
expect
(
find
.
byWidgetPredicate
(
(
Widget
widget
)
=>
widget
is
Text
&&
widget
.
data
!.
startsWith
(
'Running on:'
),
),
findsOneWidget
,
);
});
testWidgets
(
'Verify Platform version'
,
(
WidgetTester
tester
)
async
{});
}
lib/umeng_common_sdk.dart
View file @
645a1324
import
'dart:async'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/services.dart'
;
class
UmengCommonSdk
{
...
...
@@ -12,8 +13,8 @@ class UmengCommonSdk {
/// [enableLog] 是否启用日志
///
static
Future
<
bool
>
preInit
({
required
String
appKey
,
required
String
channel
,
@
required
String
appKey
,
@
required
String
channel
,
bool
enableLog
=
false
,
})
async
{
final
bool
result
=
await
_channel
.
invokeMethod
(
'preInit'
,
{
...
...
@@ -32,10 +33,10 @@ class UmengCommonSdk {
/// [pushSecret] 密钥
///
static
Future
<
bool
>
init
({
required
String
appKey
,
required
String
channel
,
@
required
String
appKey
,
@
required
String
channel
,
int
deviceType
=
1
,
String
?
pushSecret
,
String
pushSecret
,
})
async
{
final
dynamic
result
=
await
_channel
.
invokeMethod
(
'init'
,
{
'appKey'
:
appKey
,
...
...
@@ -52,8 +53,8 @@ class UmengCommonSdk {
/// [properties] 事件参数
///
static
Future
<
bool
>
onEvent
({
required
String
event
,
required
Map
<
String
,
dynamic
>
properties
,
@
required
String
event
,
@
required
Map
<
String
,
dynamic
>
properties
,
})
async
{
return
await
_channel
.
invokeMethod
(
'onEvent'
,
{
'eventId'
:
event
,
...
...
pubspec.yaml
View file @
645a1324
...
...
@@ -4,7 +4,7 @@ version: 1.2.2
homepage
:
https://www.umeng.com
environment
:
sdk
:
'
>=2.
12
.0
<3.0.0'
sdk
:
'
>=2.
7
.0
<3.0.0'
flutter
:
"
>=1.10.0"
dependencies
:
...
...
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