connect method
*connect
Connect the printer to use the methods below
Implementation
Future<int?> connect({required ElginPrinter driver}) async {
Map<String, dynamic> mapParam = new Map();
mapParam['type'] = driver.type.value;
if (driver.type == ElginPrinterType.TCP) {}
mapParam['model'] = driver.model?.value ?? 'M8';
mapParam['connection'] = driver.connection ?? '';
mapParam['param'] = driver.parameter ?? 0;
int? _connect = await platform
?.invokeMethod('startInternalPrinter', {'printerArgs': mapParam}) ??
9999;
if (_connect < 0) {
throw ElginException(_connect);
}
return _connect;
}