sunmi_printer_plus
V2 Pro Sunmi 라벨 버전 및 null 안전성 지원. 이 패키지를 사용하면 Sunmi 프린터에 연결하여 텍스트, 이미지, qrcode, 바코드 및 원하는 커스텀 Esc/Pos를 인쇄할 수 있습니다.
brasizza/sunmi_printer open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
THIS PACKAGE WILL WORK ONLY IN ANDROID!
Support Sunmi and Null Safety. I build this flutter plugin based on this: Official Sunmi Inner Printer Doc. But not all method from doc was included in this package, beacuse i don't have equipment. If you have and can help me, just contact me on github!
flutter pub add sunmi_printer_plus
Sunmi V2 Pro
Sunmi T2 mini
Sunmi V2S
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
#Just see the example folder!
// import packages
import 'package:sunmi_printer_plus/sunmi_printer_plus.dart';
// all method from sunmi printer need to async await
await SunmiPrinter.bindingPrinter(); // must bind the printer first. for more exmaple.. pls refer to example tab.
await SunmiPrinter.startTransactionPrint(true);
await SunmiPrinter.setAlignment(SunmiPrintAlign.RIGHT); // Right align
await SunmiPrinter.printText('Align right');
await SunmiPrinter.setAlignment(SunmiPrintAlign.LEFT);// Left align
await SunmiPrinter.printText('Align left');
await SunmiPrinter.setAlignment(SunmiPrintAlign.CENTER);// Center align
await SunmiPrinter.printText('Align center');
await SunmiPrinter.lineWrap(2); // Jump 2 lines
await SunmiPrinter.setFontSize(SunmiFontSize.XL); // Set font to very large
await SunmiPrinter.printText('Very Large font!');
await SunmiPrinter.resetFontSize(); // Reset font to medium size
await SunmiPrinter.setCustomFontSize(12); // SET CUSTOM FONT 12
await SunmiPrinter.printText('Custom font size!!!');
await SunmiPrinter.resetFontSize(); // Reset font to medium size
await SunmiPrinter.printQRCode('https://github.com/brasizza/sunmi_printer'); // PRINT A QRCODE
await SunmiPrinter.submitTransactionPrint(); // SUBMIT and cut paper
await SunmiPrinter.exitTransactionPrint(true); // Close the transaction
await SunmiPrinter.lcdInitialize(); //Initialize the LCD
await SunmiPrinter.lcdWakeup(); //Turn the LCD ON
await SunmiPrinter.lcdSleep(); //Turn the LCD OFF
await SunmiPrinter.lcdClear(); //Clear LCD screen
await SunmiPrinter.lcdString('Hello'); //Write a simple line
await SunmiPrinter.lcdString('Hello'); //Write a simple line
await SunmiPrinter.lcdDoubleString('Hello', 'World'); //Write two lines
Uint8List byte = await readFileBytes('assets/images/128x40.png');
await SunmiPrinter.lcdImage(byte); // Put an image in LCD
await SunmiPrinter.lcdFillString('abcDEFgj0123\$&=+', size: 16, fill: true); // Print a string and fill with zeros until the size is reached
await SunmiPrinter.lcdMultiString([ 'Welcome to flutter.', 'Align 2.',], [ 1, 2,]); // Write multiple lines with alignent
bool await SunmiPrinter.drawerStatus(); //check if the cash drawer is connect or disconnect
await SunmiPrinter.openDrawer(); //open de cash drawer
int await SunmiPrinter.drawerTimesOpen(); //How many times de cash drawer was oppened
enum PrinterMode {
NORMAL_MODE,
BLACK_LABEL_MODE,
LABEL_MODE
}
enum SunmiPrintAlign {
LEFT,
CENTER,
RIGHT,
}
enum SunmiQrcodeLevel {
LEVEL_L,
LEVEL_M,
LEVEL_Q,
LEVEL_H,
}
enum SunmiBarcodeType {
UPCA,
UPCE,
JAN13,
JAN8,
CODE39,
ITF,
CODABAR,
CODE93,
CODE128,
}
enum SunmiBarcodeTextPos {
NO_TEXT,
TEXT_ABOVE,
TEXT_UNDER,
BOTH,
}
enum SunmiFontSize {
XS,
SM,
MD,
LG,
XL,
}
의존성 목록 3 개
{"sdk":"flutter"}^1.0.4{"sdk":"flutter"}사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗