connect method

Future<int?> connect({
  1. required ElginPrinter driver,
})

*connect

Connect the printer to use the methods below

Implementation

Future<int?> connect({required ElginPrinter driver}) async {
  Map<String, dynamic> mapParam = {};
  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;
}