t6_pos_printer_plugin 0.0.6+2
t6_pos_printer_plugin: ^0.0.6+2 copied to clipboard
A Flutter plugin to enable printing on the Topwise T6 POS device.
t6_pos_printer_plugin #
A Flutter plugin for Topwise T6 POS printers to handle receipt printing with text and images.
Features #
Printer Initialization Set up the printer for use.
Add Text (Single Column) Add customizable single-column text to the print template.
Add Two Texts (Double Column) Add two separate customizable text items in the same line (e.g., name & price).
Add Bitmap Image Add a bitmap image, like a logo or QR code, to the print template.
Initiate Printing Send the prepared template to the printer.
Installation #
dependencies: t6_pos_printer_plugin: ^0.0.6
Usage #
import 'package:t6_pos_printer_plugin/t6_pos_printer_plugin.dart';
void main() async { await T6PosPrinterPlugin.initializePrinter();
// Add single text await T6PosPrinterPlugin.addText( "Welcome to Topwise!", 20, "center", bold: true, );
// Add double-column text await T6PosPrinterPlugin.addTwoTexts( "Item 1", 18, "left", false, false, true, 5, 0, "\K9.99", 18, "right", true, false, true, 5, 0, 1, 1 );
// Add an image (ensure image is converted to Uint8List) final ByteData data = await rootBundle.load('assets/logo.png'); Uint8List imageData = data.buffer.asUint8List(); await T6PosPrinterPlugin.addBitmap(imageData, width, height, false);
// Print the receipt await T6PosPrinterPlugin.printReceipt(); }
API Reference #
-
Printer Initialization
Future
-
Add Text (Single Column)
static Future
Adds a single line of text to the print template. Example: await T6PosPrinterPlugin.addText( "Hello World!", 24, "center", bold: true, );
-
Add Two Texts (Double Column)
static Future
-
Add Bitmap
static Future
-
Print Receipt
static Future