Merge branch 'null-safe' of https://github.com/qcole/mop-flutter-sdk into qcole-null-safe
# Conflicts: # README.md # example/.flutter-plugins-dependenciesmaster
commit
12c987f760
|
@ -5,56 +5,56 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.6.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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.15.0"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.3"
|
||||||
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -71,14 +71,14 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
mop:
|
mop:
|
||||||
|
@ -92,7 +92,7 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
|
@ -104,58 +104,58 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.3.0"
|
||||||
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.12.0 <3.0.0"
|
||||||
flutter: ">=1.10.0"
|
flutter: ">=2.2.3"
|
||||||
|
|
|
@ -3,7 +3,7 @@ description: Demonstrates how to use the mop plugin.
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.1.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|
|
@ -19,7 +19,7 @@ void main() {
|
||||||
expect(
|
expect(
|
||||||
find.byWidgetPredicate(
|
find.byWidgetPredicate(
|
||||||
(Widget widget) => widget is Text &&
|
(Widget widget) => widget is Text &&
|
||||||
widget.data.startsWith('Running on:'),
|
widget.data!.startsWith('Running on:'),
|
||||||
),
|
),
|
||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
|
|
46
lib/mop.dart
46
lib/mop.dart
|
@ -10,9 +10,9 @@ typedef ExtensionApiHandler = Future Function(dynamic params);
|
||||||
|
|
||||||
class Mop {
|
class Mop {
|
||||||
static final Mop _instance = new Mop._internal();
|
static final Mop _instance = new Mop._internal();
|
||||||
MethodChannel _channel;
|
late MethodChannel _channel;
|
||||||
EventChannel _mopEventChannel;
|
late EventChannel _mopEventChannel;
|
||||||
int eventId = 0;
|
late int eventId = 0;
|
||||||
List<Map<String, dynamic>> _mopEventQueye = <Map<String, dynamic>>[];
|
List<Map<String, dynamic>> _mopEventQueye = <Map<String, dynamic>>[];
|
||||||
|
|
||||||
Map<String, ExtensionApiHandler> _extensionApis = {};
|
Map<String, ExtensionApiHandler> _extensionApis = {};
|
||||||
|
@ -71,11 +71,11 @@ class Mop {
|
||||||
/// [disablePermission] is optional.
|
/// [disablePermission] is optional.
|
||||||
///
|
///
|
||||||
Future<Map> initialize(String appkey, String secret,
|
Future<Map> initialize(String appkey, String secret,
|
||||||
{String apiServer,
|
{ String? apiServer,
|
||||||
String apiPrefix,
|
String? apiPrefix,
|
||||||
String cryptType,
|
String? cryptType,
|
||||||
bool disablePermission,
|
bool? disablePermission,
|
||||||
String userId,
|
String? userId,
|
||||||
bool encryptServerData = false,
|
bool encryptServerData = false,
|
||||||
bool debug = false,
|
bool debug = false,
|
||||||
bool bindAppletWithMainProcess = false}) async {
|
bool bindAppletWithMainProcess = false}) async {
|
||||||
|
@ -106,19 +106,19 @@ class Mop {
|
||||||
/// [cryptType] is optional. cryptType, should be MD5/SM
|
/// [cryptType] is optional. cryptType, should be MD5/SM
|
||||||
Future<Map> openApplet(
|
Future<Map> openApplet(
|
||||||
final String appId, {
|
final String appId, {
|
||||||
final String path,
|
final String? path,
|
||||||
final String query,
|
final String? query,
|
||||||
final int sequence,
|
final int? sequence,
|
||||||
final String apiServer,
|
final String? apiServer,
|
||||||
final String apiPrefix,
|
final String? apiPrefix,
|
||||||
final String fingerprint,
|
final String? fingerprint,
|
||||||
final String cryptType,
|
final String? cryptType,
|
||||||
final String scene,
|
final String? scene,
|
||||||
}) async {
|
}) async {
|
||||||
Map<String, Object> params = {'appId': appId};
|
Map<String, Object> params = {'appId': appId};
|
||||||
Map param = {};
|
Map param = {};
|
||||||
if (path != null) param["path"] = path;
|
param["path"] = path;
|
||||||
if (query != null) param["query"] = query;
|
param["query"] = query;
|
||||||
if (param.length > 0) params["params"] = param;
|
if (param.length > 0) params["params"] = param;
|
||||||
if (sequence != null) params["sequence"] = sequence;
|
if (sequence != null) params["sequence"] = sequence;
|
||||||
if (apiServer != null) params["apiServer"] = apiServer;
|
if (apiServer != null) params["apiServer"] = apiServer;
|
||||||
|
@ -138,7 +138,7 @@ class Mop {
|
||||||
///
|
///
|
||||||
Future<Map<String, dynamic>> currentApplet() async {
|
Future<Map<String, dynamic>> currentApplet() async {
|
||||||
final ret = await _channel.invokeMapMethod("currentApplet");
|
final ret = await _channel.invokeMapMethod("currentApplet");
|
||||||
return Map<String, dynamic>.from(ret);
|
return Map<String, dynamic>.from(ret!);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -169,7 +169,7 @@ class Mop {
|
||||||
Future<String> sdkVersion() async {
|
Future<String> sdkVersion() async {
|
||||||
return await _channel
|
return await _channel
|
||||||
.invokeMapMethod("sdkVersion")
|
.invokeMapMethod("sdkVersion")
|
||||||
.then((value) => value["data"]);
|
.then((value) => value?["data"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -187,7 +187,7 @@ class Mop {
|
||||||
String qrCode, String apiServer) async {
|
String qrCode, String apiServer) async {
|
||||||
final ret = await _channel.invokeMapMethod("parseAppletInfoFromWXQrCode",
|
final ret = await _channel.invokeMapMethod("parseAppletInfoFromWXQrCode",
|
||||||
{"qrCode": qrCode, "apiServer": apiServer});
|
{"qrCode": qrCode, "apiServer": apiServer});
|
||||||
return Map<String, dynamic>.from(ret);
|
return Map<String, dynamic>.from(ret!);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -204,7 +204,7 @@ class Mop {
|
||||||
_extensionApis["getCustomMenus"] = (params) async {
|
_extensionApis["getCustomMenus"] = (params) async {
|
||||||
final res = await handler.getCustomMenus(params["appId"]);
|
final res = await handler.getCustomMenus(params["appId"]);
|
||||||
List<Map<String, dynamic>> list = [];
|
List<Map<String, dynamic>> list = [];
|
||||||
res?.forEach((element) {
|
res.forEach((element) {
|
||||||
Map<String, dynamic> map = Map();
|
Map<String, dynamic> map = Map();
|
||||||
map["menuId"] = element.menuId;
|
map["menuId"] = element.menuId;
|
||||||
map["image"] = element.image;
|
map["image"] = element.image;
|
||||||
|
@ -238,7 +238,7 @@ class Mop {
|
||||||
Future<String> getSMSign(String plainText) async {
|
Future<String> getSMSign(String plainText) async {
|
||||||
var result =
|
var result =
|
||||||
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
|
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
|
||||||
var data = result['data']['data'];
|
var data = result?['data']['data'];
|
||||||
print(data);
|
print(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
38
pubspec.lock
38
pubspec.lock
|
@ -5,49 +5,49 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.6.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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -64,21 +64,21 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
|
@ -90,58 +90,58 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.3.0"
|
||||||
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
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.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.12.0 <3.0.0"
|
||||||
flutter: ">=1.10.0"
|
flutter: ">=2.2.3"
|
||||||
|
|
|
@ -4,8 +4,8 @@ version: '2.34.3'
|
||||||
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
homepage: https://github.com/finogeeks/mop-flutter-sdk
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.1.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
flutter: '^1.10.0'
|
flutter: '^2.2.3'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|
Loading…
Reference in New Issue