8
votes

i m new to Flutter, and basicly i m still learning. I need to create a "print" receipt through a bluetooth printer module. The case is about shop app, i select some items, and it sums the total price. In the end i submitted, and it prints the receipt through bluetooth printer. I ve tried to search some plugin like pauldemarco's flutter_blue, but i still didnt get it how to do the print thing. I m using flutter, and i pull the data from MySQL.

My question is, "How to print a receipt display using bluetooth printer"?

Can anyone provide me some simple explanation, and if i can kindly ask a simple example code for it?

Thanks in advance.

2
Hi, welcome to stack overflow. Please refer the How to Ask link for more details on how to ask a question and update your question accordingly. - Jeroen Heier
did you find out the answer? I have the same question. - GPH

2 Answers

3
votes

Bluetooth API is a platform-specific API, so you should use Platform Channel in Flutter to deal with those APIs in the separate platform (Android and iOS). In a word, Platform Channel supports you communicate between Dart module and native module (android and ios)

From Dart module, user triggers an action of printing something, Dart module will send a message to the native module to request printing action, native module calls some specific APIs of OS to do it and when it's done, the native module sends back the result to Dart module to show the result to user.

2
votes

You should try flutter-blue.dart for bluetooth receipt printer