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);
class SharetraceFlutterPlugin {
static const MethodChannel _channel = const MethodChannel('sharetrace_flutter_plugin');
static final SharetraceFlutterPlugin _instance = SharetraceFlutterPlugin._internal();
static SharetraceFlutterPlugin _instance;
SharetraceFlutterPlugin._internal() {
_channel.setMethodCallHandler(_onMethodHandle);
}
factory SharetraceFlutterPlugin.getInstance() => _getInstance();
static _getInstance() {
if (_instance == null) {
_instance = SharetraceFlutterPlugin._internal();
}
return _instance;
}
factory SharetraceFlutterPlugin.getInstance() => _getInstance();
void init(){
_channel.invokeMethod("init");
}
Future defaultHandler() async {}
ResponseHandler _installRespHandler;
ResponseHandler _wakeupRespHandler;
late ResponseHandler _installRespHandler;
late ResponseHandler _wakeupRespHandler;
Future<Null> _onMethodHandle(MethodCall call) async {
Future _onMethodHandle(MethodCall call) async {
if (call.method == "onInstallResponse") {
if (_installRespHandler != null) {
return _installRespHandler(call.arguments.cast<String, String>());
}
return defaultHandler();
return _installRespHandler(call.arguments.cast<String, String>());
} else if (call.method == "onWakeupResponse") {
if (_wakeupRespHandler != null) {
return _wakeupRespHandler(call.arguments.cast<String, String>());
}
return defaultHandler();
return _wakeupRespHandler(call.arguments.cast<String, String>());
}
}
void init(){
_channel.invokeMethod("init");
}
void registerWakeupHandler(ResponseHandler responseHandler) {
_wakeupRespHandler = responseHandler;
......
......@@ -7,49 +7,49 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0-nullsafety.3"
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
......@@ -66,21 +66,21 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.10-nullsafety.1"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.1"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
......@@ -92,56 +92,56 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.19-nullsafety.2"
version: "0.4.2"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.10.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
......@@ -4,8 +4,8 @@ version: 1.5.5
homepage: https://www.sharetrace.com/
environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.10.0"
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
dependencies:
flutter:
......@@ -15,50 +15,11 @@ dev_dependencies:
flutter_test:
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:
# 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:
platforms:
android:
package: com.sharetrace.sharetrace_flutter_plugin
pluginClass: SharetraceFlutterPlugin
ios:
pluginClass: SharetraceFlutterPlugin
# 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
pluginClass: SharetraceFlutterPlugin
\ No newline at end of file
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