Commit d700618d authored by 汪林玲's avatar 汪林玲

增加null-safety,和引入说明

parent 07671352
## 0.0.1
* TODO: Describe initial release.
TODO: Add your license here.
...@@ -7,49 +7,49 @@ packages: ...@@ -7,49 +7,49 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.8.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
...@@ -66,21 +66,21 @@ packages: ...@@ -66,21 +66,21 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -92,49 +92,49 @@ packages: ...@@ -92,49 +92,49 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.4.2"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
umeng_crash: umeng_crash:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -148,7 +148,7 @@ packages: ...@@ -148,7 +148,7 @@ packages:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=1.22.0" flutter: ">=1.22.0"
...@@ -12,11 +12,11 @@ class UmengCrash { ...@@ -12,11 +12,11 @@ class UmengCrash {
/// [appKey] 友盟控制台的appKey /// [appKey] 友盟控制台的appKey
/// [channel] 渠道:应用宝、小米应用商店、appstore等 /// [channel] 渠道:应用宝、小米应用商店、appstore等
/// ///
static Future<bool> preInit({ static Future<bool?> preInit({
@required String appKey, required String appKey,
@required String channel, required String channel,
}) async { }) async {
final bool result = await _channel final bool? result = await _channel
.invokeMethod('preInit', {'appKey': appKey, 'channel': channel}); .invokeMethod('preInit', {'appKey': appKey, 'channel': channel});
return result; return result;
} }
...@@ -28,13 +28,13 @@ class UmengCrash { ...@@ -28,13 +28,13 @@ class UmengCrash {
/// [deviceType] 设备类型 1、手机 2、android机顶盒等 /// [deviceType] 设备类型 1、手机 2、android机顶盒等
/// [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 bool result = await _channel.invokeMethod('init', { final bool? result = await _channel.invokeMethod('init', {
'appKey': appKey, 'appKey': appKey,
'channel': channel, 'channel': channel,
'deviceType': deviceType, 'deviceType': deviceType,
...@@ -49,12 +49,12 @@ class UmengCrash { ...@@ -49,12 +49,12 @@ class UmengCrash {
/// [subVersion] 发布类型, "release", /// [subVersion] 发布类型, "release",
/// [buildId] 版本id, "0001" /// [buildId] 版本id, "0001"
/// ///
static Future<bool> setAppVersion({ static Future<bool?> setAppVersion({
@required String version, required String version,
@required String subVersion, required String subVersion,
@required String buildId, required String buildId,
}) async { }) async {
final bool result = await _channel.invokeMethod('setAppVersion', { final bool? result = await _channel.invokeMethod('setAppVersion', {
'version': version, 'version': version,
'subVersion': subVersion, 'subVersion': subVersion,
'buildId': buildId, 'buildId': buildId,
...@@ -67,11 +67,11 @@ class UmengCrash { ...@@ -67,11 +67,11 @@ class UmengCrash {
/// [e] 异常信息 /// [e] 异常信息
/// [type] 异常类型 /// [type] 异常类型
/// ///
static Future<bool> generateCustomLog({ static Future<bool?> generateCustomLog({
@required String e, required String e,
@required String type, required String type,
}) async { }) async {
final bool result = await _channel.invokeMethod('generateCustomLog', { final bool? result = await _channel.invokeMethod('generateCustomLog', {
'e': e, 'e': e,
'type': type, 'type': type,
}); });
...@@ -82,21 +82,21 @@ class UmengCrash { ...@@ -82,21 +82,21 @@ class UmengCrash {
/// 程序退出时,用于保存统计数据的API。 /// 程序退出时,用于保存统计数据的API。
/// 如果开发者调用kill或者exit之类的方法杀死进程,或者双击back键会杀死进程,请务必在此之前调用onKillProcess方法,用来保存统计数据。 /// 如果开发者调用kill或者exit之类的方法杀死进程,或者双击back键会杀死进程,请务必在此之前调用onKillProcess方法,用来保存统计数据。
/// ///
static Future<bool> onKillProcess() async { static Future<bool?> onKillProcess() async {
final bool result = await _channel.invokeMethod('onKillProcess'); final bool? result = await _channel.invokeMethod('onKillProcess');
return result; return result;
} }
/// ///
/// 可选 /// 可选
/// ///
static Future<String> get getOaid async { static Future<String?> get getOaid async {
final String version = await _channel.invokeMethod('getOaid'); final String? version = await _channel.invokeMethod('getOaid');
return version; return version;
} }
static Future<String> get platformVersion async { static Future<String?> get platformVersion async {
final String version = await _channel.invokeMethod('getPlatformVersion'); final String? version = await _channel.invokeMethod('getPlatformVersion');
return version; return version;
} }
} }
...@@ -7,49 +7,49 @@ packages: ...@@ -7,49 +7,49 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.8.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
...@@ -66,21 +66,21 @@ packages: ...@@ -66,21 +66,21 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -92,56 +92,56 @@ packages: ...@@ -92,56 +92,56 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.4.2"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=1.22.0" flutter: ">=1.22.0"
...@@ -4,7 +4,7 @@ version: 2.0.1 ...@@ -4,7 +4,7 @@ version: 2.0.1
homepage: A new Flutter umeng. homepage: A new Flutter umeng.
environment: environment:
sdk: ">=2.8.0 <3.0.0" sdk: '>=2.12.0 <3.0.0'
flutter: ">=1.22.0" flutter: ">=1.22.0"
dependencies: dependencies:
......
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:umeng_crash/umeng_crash.dart';
void main() {
const MethodChannel channel = MethodChannel('umeng_crash');
TestWidgetsFlutterBinding.ensureInitialized();
setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
return '42';
});
});
tearDown(() {
channel.setMockMethodCallHandler(null);
});
test('getPlatformVersion', () async {
expect(await UmengCrash.platformVersion, '42');
});
}
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