Commit 645a1324 authored by 汪林玲's avatar 汪林玲

更新

parent d3dbadcb
...@@ -6,7 +6,7 @@ description: Demonstrates how to use the umeng_common_sdk plugin. ...@@ -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 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.7.0 <3.0.0'
dependencies: dependencies:
flutter: flutter:
......
...@@ -8,20 +8,6 @@ ...@@ -8,20 +8,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:umeng_common_sdk_example/main.dart';
void main() { void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async { 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,
);
});
} }
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class UmengCommonSdk { class UmengCommonSdk {
...@@ -12,8 +13,8 @@ class UmengCommonSdk { ...@@ -12,8 +13,8 @@ class UmengCommonSdk {
/// [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', {
...@@ -32,10 +33,10 @@ class UmengCommonSdk { ...@@ -32,10 +33,10 @@ class UmengCommonSdk {
/// [pushSecret] 密钥 /// [pushSecret] 密钥
/// ///
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,
}) async { }) async {
final dynamic result = await _channel.invokeMethod('init', { final dynamic result = await _channel.invokeMethod('init', {
'appKey': appKey, 'appKey': appKey,
...@@ -52,8 +53,8 @@ class UmengCommonSdk { ...@@ -52,8 +53,8 @@ class UmengCommonSdk {
/// [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,
......
...@@ -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.12.0 <3.0.0' sdk: '>=2.7.0 <3.0.0'
flutter: ">=1.10.0" flutter: ">=1.10.0"
dependencies: dependencies:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment