Flutter package blue_thermal_printer cash drawer failed to trigger

831 Views Asked by At
import 'package:blue_thermal_printer/blue_thermal_printer.dart';
BlueThermalPrinter bluetooth = BlueThermalPrinter.instance;
extension PrintSize on Size {
  int get val {
    switch (this) {
      case Size.medium:
        return 0;
      case Size.bold:
        return 1;
      case Size.boldMedium:
        return 2;
      case Size.boldLarge:
        return 3;
      case Size.extraLarge:
        return 4;
      default:
        return 0;
    }
  }
}
sample() async {

    await bluetooth.isConnected.then((isConnected) {
      if (isConnected == true) {
        bluetooth.printNewLine();
        bluetooth.printCustom("Receipt", Size.boldMedium.val, Align.center.val);
        bluetooth.printNewLine();
        bluetooth.printCustom("TEST PRINT", Size.bold.val, Align.center.val);
        bluetooth.printNewLine();
        bluetooth.paperCut();
        **bluetooth.drawerPin5(); // i called this function for my drawer but nothing happen**
      }
    });

Anyone know how to trigger cash drawer especially in flutter app ? I expecting the drawer will auto open when printing the receipt after make payment.

Currently others package like esc_pos_printer all facing the issue of versioning ERROR : # Build failed due to use of deprecated Android v1 embedding.

0

There are 0 best solutions below