sunmi_printer_plus 4.1.0 copy "sunmi_printer_plus: ^4.1.0" to clipboard
sunmi_printer_plus: ^4.1.0 copied to clipboard

PlatformAndroid

Support V2 Pro Sunmi Label Version and Null safety. With this package you can connect with Sunmi printers, print text, image, qrcode, barcodes and a custom Esc/Pos if you like.

Sunmi printer 4.0.0 #

Package Sunmi printer will support all sunmi devices with different behaviours

Important #

THIS PACKAGE WILL WORK ONLY IN ANDROID!

This flutter plugin based Official Sunmi Inner Printer Doc using the latest implementation libs Documentation

You can help me out to keep this package updated! Donate

Installation #

 flutter pub add sunmi_printer_plus
copied to clipboard

Should be a bit break change between versions below 4.0 #

What this package do #

  • ✅ Write some text (with style or not!)
  • ✅ Change font size
  • ✅ Jump (n) lines
  • ✅ Draw a divisor line
  • ✅ Bold mode on/off
  • ✅ Print all types of Barcodes (see enum below)
  • ✅ Print Qrcodes with custom width and error-level
  • ✅ Print image from asset or from web (example show how to print both)
  • ✅ Print rows like recepit with custom width and alignment
  • ✅ Able to combine with some esc/pos code that you already have!
  • ✅ Cut paper - Dedicated method just to cut the line
  • ✅ Printer serial no - Get the serial number of the printer
  • ✅ Printer version - Get the printer's version
  • ✅ Printer paper size - Get the paper size ( 0: 80mm 1: 58mm)
  • ✅ LCD Print a image
  • ✅ LCD Print a string
  • ✅ Open de cash drawer
  • ✅ Check if the cash drawer is open of close

You can run the project cloning the repository below #

Repository - then change branch to version-4.0 Logo

You can also combine this package with the package esc_pos_utils #

With this package you can create a custom escpos and than you don't need to use any other command. This is good if you already have a code that another printers use, and u can reuse this code as well

// import packages
import 'package:sunmi_printer_plus/sunmi_printer_plus.dart';




copied to clipboard

Example code when use SunmiPrinter #

        await SunmiPrinter.printText('Simple raw text');
        await SunmiPrinter.printText('Bold text centered',
            style: SunmiTextStyle(
            bold: true,
            align: SunmiPrintAlign.CENTER,
            ));

        await SunmiPrinter.lineWrap(2); // Jump 2 lines
        await SunmiPrinter.printText('Very Large font!',
            style: SunmiTextStyle(
            fontSize: 80,
            ));
                          
        await SunmiPrinter.printText('Custom font size!!!',
            style: SunmiTextStyle(
            fontSize: 32,
            ));
                          
        await SunmiPrinter.printQRCode(
            'https://github.com/brasizza/sunmi_printer',
            style: SunmiQrcodeStyle(
            qrcodeSize: 3,
            errorLevel: SunmiQrcodeLevel.LEVEL_H,
            )); // PRINT A QRCODE

copied to clipboard

Example code for LCD functions #

await SunmiLcd.configLCD(SunmiLCDStatus)
 await SunmiLcd.lcdString('Hello'); //Write a simple line 
 await SunmiLcd.lcdString('Hello' , 12 , true); //Write a simple line with 12 in size and fill screen

 Uint8List byte = await readFileBytes('assets/images/128x40.png');
 await SunmiLcd.lcdImage(byte); // Put an image in LCD

copied to clipboard

Example to open the cashier #

  bool await SunmiDrawer.i.isDrawerOpen(); //check if the cash drawer is connect or disconnect

  await SunmiDrawer.i.openDrawer(); //open de cash drawer


copied to clipboard

List of enum printer mode #

enum PrinterMode {
  NORMAL_MODE,
  BLACK_LABEL_MODE, 
  LABEL_MODE
}
copied to clipboard

List of enum Alignments #

enum SunmiPrintAlign {
  LEFT,
  CENTER,
  RIGHT,
}
copied to clipboard

List of enum Qrcode levels #

enum SunmiQrcodeLevel {
  LEVEL_L,
  LEVEL_M,
  LEVEL_Q,
  LEVEL_H,
}
copied to clipboard

List of enum Barcode types #

enum SunmiBarcodeType {
  UPCA,
  UPCE,
  JAN13,
  JAN8,
  CODE39,
  ITF,
  CODABAR,
  CODE93,
  CODE128,
}
copied to clipboard

List of enum Text position in barcode #

enum SunmiBarcodeTextPos {
  NO_TEXT,
  TEXT_ABOVE,
  TEXT_UNDER,
  BOTH,
}
copied to clipboard

List of enum Font sizes #

enum SunmiFontSize {
  XS,
  SM,
  MD,
  LG,
  XL,
}
copied to clipboard

List of enum SunmiLCDStatus #

enum SunmiLCDStatus {
  INIT,
  WAKE,
  SLEEP,
  CLEAR,
}
copied to clipboard
129
likes
160
points
6.7k
downloads

Publisher

verified publishermarcus.brasizza.com

Weekly Downloads

2024.09.16 - 2025.03.31

Support V2 Pro Sunmi Label Version and Null safety. With this package you can connect with Sunmi printers, print text, image, qrcode, barcodes and a custom Esc/Pos if you like.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on sunmi_printer_plus