Flutter POS receipt printing

Devin Rathnayake
2 min readMar 1, 2021

Hello guys. this article about printing receipts on a flutter application. I saw some articles about this topic, but They could not solve my problem. Here I hope to share our steps to print a receipt from the flutter application. Don’t worry guys it’s not a hard process. flutter able to perform native features like Bluetooth, camera, GPS …etc. So using Bluetooth we can connect a Bluetooth printer and print a receipt easily.

First, you need to select a Bluetooth-enabled printer. When we selecting a printer we were stuck in choosing which one is compatible with our task. So we ordered a portable printer and below the picture, you can see it.

Don’t too much worry about selecting a printer. because I think if the printer has Bluetooth function it is enough.

The next part is the most important one. What is the flutter package for this? The answer is

blue_thermal_printer: ^1.1.1

I graduate developer who has developed this package and it works, he saved me. you need to add this package pubspec.yaml and run flutter pub get command

now next parts are programming things. I will explain steps by step so everyone can understand.

I followed the example code given by the package developer if you cant understand my steps you can check it by yourself.

Original Github repo Link:

https://github.com/kakzaki/blue_thermal_printer

first, you have to create a print widget, which I named a printing screen.

now you have to create a receipt model and execute that model when pressing a button. In simple terms, you have to design a receipt, how it displays data. If you are using State management in a flutter. It will easy to get data to print.

if you didn’t use state management you can pass the data as an argument in the print screen take the data in there.

sample receipt

I need to salute once again the developer who is developed this useful package. all credits should go for him.

I tried sharing my experience printing receipts in the flutter. So flutter is able to handle Bluetooth functions. So developers have nothing to worry about it. I hope my article is useful and you get something.

stay safe thank you bye.

--

--

Devin Rathnayake

IT undergraduate, IT person. Love to share knowledge with others. Feel free to contact me at anytime.