sendAuth function
Implementation
Future<void> sendAuth({
required BuildContext mContext,
required String openId,
required String scope,
String language = "en",
bool supportScan = false,
int isTest = 0,
}) async {
assert(scope != null && scope.trim().isNotEmpty);
bool isInstalledLema = false;
if (Platform.isAndroid) {
isInstalledLema = await isLemaPayInstalled();
}
print("install->$isInstalledLema");
if (!isInstalledLema) {
final result = await Navigator.push(
mContext,
CupertinoPageRoute(
builder: (context) => AuthPage(
scope: scope,
appid: openId,
isTest: isTest,
language: language,
supportScan: supportScan,
),
),
);
if (null != result) {
print("返回的内容=$result");
_responseAuthController.add(
LMAuthResponse.fromMap(result),
);
}
} else {
await _channel.invokeMethod("sendAuth", {"scope": scope});
}
}