printRaw method

Future<int> printRaw(
  1. List<int> rawList
)

*printRaw

This method you can send a raw esc/pos string to the printer. see the example folder for more instructions how to do it!

Implementation

Future<int> printRaw(List<int> rawList) async {
  await reset();
  Map<String, dynamic> mapParam = {};
  Uint8List list = Uint8List.fromList(rawList);
  mapParam['data'] = list;
  mapParam['bytes'] = list.lengthInBytes;
  int? raw =
      await platform?.invokeMethod('printRaw', {'rawArgs': mapParam}) ?? 9999;

  if (raw < 0) {
    throw ElginException(raw);
  }
  return raw;
}