调整方法注释和顺序

master
wanghualei 2023-03-27 18:10:41 +08:00
parent 6597433980
commit 462ef3382e
1 changed files with 85 additions and 85 deletions

View File

@ -1032,18 +1032,30 @@ class Mop {
return ret;
}
/// get current using applet
/// 使
/// {appId,name,icon,description,version,thumbnail}
Future<Map<String, dynamic>> currentApplet() async {
final ret = await _channel.invokeMapMethod("currentApplet");
return Map<String, dynamic>.from(ret!);
///
/// [qrcode]
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'qrcode': qrcode,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
}
Future<Map<String, dynamic>> changeUserId(String userId) async {
Map<String, Object> params = {'userId': userId};
final ret = await _channel.invokeMapMethod("changeUserId", params);
return Map<String, dynamic>.from(ret!);
/// --
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'info': info,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("scanOpenApplet", params);
}
///
Future<void> closeApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"closeApplet", {"appletId": appletId, "animated": animated});
return;
}
/// close all running applets
@ -1052,10 +1064,11 @@ class Mop {
return await _channel.invokeMethod("closeAllApplets");
}
/// clear applets cache
///
Future clearApplets() async {
return await _channel.invokeMethod("clearApplets");
///
Future<void> finishRunningApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"finishRunningApplet", {"appletId": appletId, "animated": animated});
return;
}
///
@ -1070,30 +1083,18 @@ class Mop {
return await _channel.invokeMethod("removeAllUsedApplets", params);
}
///
Future<String> sdkVersion() async {
return await _channel
.invokeMapMethod("sdkVersion")
.then((value) => value?["data"]);
/// clear applets cache
///
Future clearApplets() async {
return await _channel.invokeMethod("clearApplets");
}
/// --
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'info': info,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("scanOpenApplet", params);
}
///
/// [qrcode]
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'qrcode': qrcode,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
/// get current using applet
/// 使
/// {appId,name,icon,description,version,thumbnail}
Future<Map<String, dynamic>> currentApplet() async {
final ret = await _channel.invokeMapMethod("currentApplet");
return Map<String, dynamic>.from(ret!);
}
/// QrCode
@ -1152,49 +1153,11 @@ class Mop {
_channel.invokeMethod("registerExtensionApi", {"name": name});
}
///
Future<String> getSMSign(String plainText) async {
var result =
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
var data = result?['data']['data'];
debugPrint(data);
return data;
}
/// WKWebView
void webViewBounces(bool bounces) async {
await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces});
return;
}
///
Future<void> closeApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"closeApplet", {"appletId": appletId, "animated": animated});
return;
}
///
Future<void> finishRunningApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"finishRunningApplet", {"appletId": appletId, "animated": animated});
return;
}
///
Future setActivityTransitionAnim(Anim anim) async {
await _channel.invokeMethod("setActivityTransitionAnim", {"anim": ""});
return;
}
///
/// [appId] id
/// [eventData]
Future<void> sendCustomEvent(
String appId, Map<String, dynamic> eventData) async {
await _channel.invokeMethod(
"sendCustomEvent", {"appId": appId, "eventData": eventData});
return;
/// register webview extension api
/// webviewapi
void addWebExtentionApi(String name, ExtensionApiHandler handler) {
_webExtensionApis[name] = handler;
_channel.invokeMethod("addWebExtentionApi", {"name": name});
}
/// webviewjs
@ -1213,14 +1176,51 @@ class Mop {
return;
}
/// register webview extension api
/// webviewapi
void addWebExtentionApi(String name, ExtensionApiHandler handler) {
_webExtensionApis[name] = handler;
_channel.invokeMethod("addWebExtentionApi", {"name": name});
///
/// [appId] id
/// [eventData]
Future<void> sendCustomEvent(
String appId, Map<String, dynamic> eventData) async {
await _channel.invokeMethod(
"sendCustomEvent", {"appId": appId, "eventData": eventData});
return;
}
///
Future<Map<String, dynamic>> changeUserId(String userId) async {
Map<String, Object> params = {'userId': userId};
final ret = await _channel.invokeMapMethod("changeUserId", params);
return Map<String, dynamic>.from(ret!);
}
///
Future<String> sdkVersion() async {
return await _channel
.invokeMapMethod("sdkVersion")
.then((value) => value?["data"]);
}
///
Future<String> getSMSign(String plainText) async {
var result =
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
var data = result?['data']['data'];
debugPrint(data);
return data;
}
/// WKWebViewiOS
void webViewBounces(bool bounces) async {
await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces});
return;
}
/// Android
Future setActivityTransitionAnim(Anim anim) async {
await _channel.invokeMethod("setActivityTransitionAnim", {"anim": ""});
return;
}
/// Android
void moveCurrentAppletToFront() async {
return await _channel.invokeMethod("moveCurrentAppletToFront");
}