Skip to content

A Flutter plugin for accessing the thermal printer on SunMi devices.

License

Notifications You must be signed in to change notification settings

trilobyte-my/sunmi_thermal_printer

Repository files navigation

sunmi_thermal_printer

A Flutter plugin for accessing the thermal printer on SunMi devices.

Tested on: SunMi V2 Pro

Probably works on other Sunmi devices equipped with SEIKO thermal printer.

Getting Started

Add this plugin under dependencies to pubspec.yaml:

dependencies:
  sunmi_thermal_printer:
    git:
      url: git://github.com/brian-quah/sunmi_thermal_printer.git
      ref: master

Required permissions in AndroidManifest.xml:

<uses-permission android:name="android.permission.BLUETOOTH" />

Needed to set up a virtual Bluetooth connection to communicate with the printer on the device.

In android/app/build.gradle: Make sure minSdkVersion is set to 19 or above Add to your dependencies:

implementation group: 'com.google.zxing', name: 'core', version: '3.4.0'

Usage Example

// instantiate and queue your instructions
var printer = SunmiThermalPrinter()
  ..println('HELLO WORLD!')
  ..divider()
  ..qr('HELLO WORLD!', moduleSize: 8);
// execute printing
printer.exec();

See example app for a detailed receipt example.

About

A Flutter plugin for accessing the thermal printer on SunMi devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published