Flutter with thermal printer

Tram Ho

I. Introduction:

  • I guess flutter is no stranger to everyone, so I won’t recommend it anymore
  • Please allow me to go straight to the topic =))

II. Printer:

This is a picture of my printer, it’s a thermal printer

III. Flutter:

  • To use this bluetooth printer I use the bluetooth_print library
  • Here is the code

  • When running build you will get 1 error code as follows

  • This is an android error code that requires its sdk to at least version 21, while currently it is version 16
  • Here, you go to the file build.gradle in the following path: android/app/build.gradle
  • Find the defaultConfig , edit minSdkVersion to 21

  • Run as usual, but maybe later it will improve the version so please read the error carefully to see which version it needs
  • This code is pretty clear so I don’t have much to explain, so stop showing the interface and images when printing for everyone to see.
  • Interface on the virtual machine

  • Invoice when printing

IV. Conclusion

  • The disadvantage of thermal printers is that there will be machines that support Vietnamese and not
  • Unfortunately my device is not supporting
  • I have searched many sites online but none of them have been successful
  • But in the difficulty is the near wisdom
  • It is converting these typefaces into images and then printing the images: v
  • I don’t know if it will work or not because these days are too busy so I haven’t tried it yet, I don’t know if any of you have tried it, if you give me some experience
  • Well, and you can see your article considered example is okay, that’s right: v
  • Because I wrote this article only to shorten what is easy to see before digging into it
  • The pain when a beginner learns something like me is to find an example but there is so much inside, and sometimes it even causes an error, I have to find a fix to @@, and read don’t understand anything in, bored: v
  • Hopefully my next article will share with everyone how to print Vietnamese in pictures: v
Share the news now

Source : Viblo