BluetoothThermalPrinter
BluetoothThermalPrinter copied to clipboard
How to disconnect from one printer and reconnect to another?
Hello @Rajath4 Thank you for maintaining this package. I was glad that it is the one that fits my receipt printing needs. I have an issue when I tried disconnecting from the currently connected printer to connect to another one.
Let me give you more details about my use case
I have a restaurant point of sale app. After a sale is made, I would like to print a receipt for the customer with the printer at the cashier and print the order with the printer located in the kitchen so the cook can make the meal.
So I need to be able to print on both printer simultaneously. When I use this package, and tried the scenario, both the receipt and the order are getting printed from the same printer.. If I try one printer and switch to the other and print, the printing still goes to the previous printer.
Also I have no way of knowing what printer I is currently connected. Is there a way to know what printer is connected?
Is there a way to disconnect and reconnect to another printer on the fly?
like
await BluetoothThermalPrinter.connect(_receiptPrinter.mac);
//... more code here
//manually disconnect from receipt printer here
await BluetoothThermalPrinter.disconnect();
//or the next .connect(mac) call would disconnect the currently connected printer
///before connecting the new one
await BluetoothThermalPrinter.connect(_orderPrinter.mac);
//... more code here
Thank you all
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version
10.0.19042.1052], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version
30.0.3)