更改提示文字

master
张萌 3 years ago
parent a642670f57
commit f0b2982229

@ -42,7 +42,7 @@ public class Blutooth {
bluetoothSetup(); bluetoothSetup();
searchflags = false; searchflags = false;
disconnectflags = false; disconnectflags = false;
System.out.println("初始化完成"); System.out.println("打印机蓝牙初始化完成");
} }
//初始化连接监听 //初始化连接监听

@ -77,6 +77,7 @@ public class DjPrinterPlugin implements FlutterPlugin, MethodCallHandler {
e.printStackTrace(); e.printStackTrace();
} }
} else if (call.method.equals("init")) { } else if (call.method.equals("init")) {
System.out.println("打印机初始化");
blutooth.init(); blutooth.init();
asPrint = new AsPrint(); asPrint = new AsPrint();

@ -69,6 +69,10 @@ class DjPrinter {
final res = _channel.invokeMethod('startSearch'); final res = _channel.invokeMethod('startSearch');
} }
bool _hasInit = false;
bool get hasInit => _hasInit;
Future<bool?> connect(String address) async { Future<bool?> connect(String address) async {
final res = await _channel.invokeMethod('connect', {'address': address}); final res = await _channel.invokeMethod('connect', {'address': address});
return res; return res;
@ -86,6 +90,7 @@ class DjPrinter {
Future<bool?> init() async { Future<bool?> init() async {
final res = await _channel.invokeMethod('init'); final res = await _channel.invokeMethod('init');
_hasInit = true;
return res; return res;
} }

Loading…
Cancel
Save