Commit 2d382993 authored by 汪林玲's avatar 汪林玲

dart >=2.12.0 <3.0.0

parent af0efb47
...@@ -7,42 +7,33 @@ typedef Future<dynamic> ResponseHandler(Map<String, String> data); ...@@ -7,42 +7,33 @@ typedef Future<dynamic> ResponseHandler(Map<String, String> data);
class SharetraceFlutterPlugin { class SharetraceFlutterPlugin {
static const MethodChannel _channel = const MethodChannel('sharetrace_flutter_plugin'); static const MethodChannel _channel = const MethodChannel('sharetrace_flutter_plugin');
static final SharetraceFlutterPlugin _instance = SharetraceFlutterPlugin._internal();
static SharetraceFlutterPlugin _instance;
SharetraceFlutterPlugin._internal() { SharetraceFlutterPlugin._internal() {
_channel.setMethodCallHandler(_onMethodHandle); _channel.setMethodCallHandler(_onMethodHandle);
} }
factory SharetraceFlutterPlugin.getInstance() => _getInstance();
static _getInstance() { static _getInstance() {
if (_instance == null) {
_instance = SharetraceFlutterPlugin._internal();
}
return _instance; return _instance;
} }
factory SharetraceFlutterPlugin.getInstance() => _getInstance();
void init(){
_channel.invokeMethod("init");
}
Future defaultHandler() async {}
ResponseHandler _installRespHandler; late ResponseHandler _installRespHandler;
ResponseHandler _wakeupRespHandler; late ResponseHandler _wakeupRespHandler;
Future<Null> _onMethodHandle(MethodCall call) async { Future _onMethodHandle(MethodCall call) async {
if (call.method == "onInstallResponse") { if (call.method == "onInstallResponse") {
if (_installRespHandler != null) { return _installRespHandler(call.arguments.cast<String, String>());
return _installRespHandler(call.arguments.cast<String, String>());
}
return defaultHandler();
} else if (call.method == "onWakeupResponse") { } else if (call.method == "onWakeupResponse") {
if (_wakeupRespHandler != null) { return _wakeupRespHandler(call.arguments.cast<String, String>());
return _wakeupRespHandler(call.arguments.cast<String, String>());
}
return defaultHandler();
} }
} }
void init(){
_channel.invokeMethod("init");
}
void registerWakeupHandler(ResponseHandler responseHandler) { void registerWakeupHandler(ResponseHandler responseHandler) {
_wakeupRespHandler = responseHandler; _wakeupRespHandler = responseHandler;
......
...@@ -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.10.0" flutter: ">=2.0.0"
...@@ -4,8 +4,8 @@ version: 1.5.5 ...@@ -4,8 +4,8 @@ version: 1.5.5
homepage: https://www.sharetrace.com/ homepage: https://www.sharetrace.com/
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.10.0" flutter: ">=2.0.0"
dependencies: dependencies:
flutter: flutter:
...@@ -15,50 +15,11 @@ dev_dependencies: ...@@ -15,50 +15,11 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter: flutter:
# This section identifies this Flutter project as a plugin project.
# The 'pluginClass' and Android 'package' identifiers should not ordinarily
# be modified. They are used by the tooling to maintain consistency when
# adding or updating assets for this project.
plugin: plugin:
platforms: platforms:
android: android:
package: com.sharetrace.sharetrace_flutter_plugin package: com.sharetrace.sharetrace_flutter_plugin
pluginClass: SharetraceFlutterPlugin pluginClass: SharetraceFlutterPlugin
ios: ios:
pluginClass: SharetraceFlutterPlugin pluginClass: SharetraceFlutterPlugin
\ No newline at end of file
# To add assets to your plugin package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# To add custom fonts to your plugin package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages
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