enterScanning method
dynamic
enterScanning(
- dynamic callback(
- bool isSuccess,
- String msg
)
)
Implementation
enterScanning(Function(bool isSuccess, String msg) callback) {
wifiSetting(callback: (isSuccess) {
getScannerInfo((isSuccess) {
if (isSuccess) {
if (Platform.isIOS) {
//iOS需要手动停止监听网络连接情况
MethodChannel methodChannel = const MethodChannel(messageChannelID);
Map map = {
'wifiName': '',
'wifiPassword': '',
'operation': 'stopReaching'
};
methodChannel.invokeListMethod("flutterCallNativeWifi", map);
}
if (model!.scan!) {
startScan();
} else {}
} else {
callback(false, '获取扫描仪数据失败,请重试');
}
});
});
}