sk58_printer library
SK58 Thermal Printer Library
A Flutter library for communicating with SK58 thermal printers via Bluetooth.
Quick Start
import 'package:sk58_printer/sk58_printer.dart';
// Scan for devices
final scanner = Sk58Scanner();
await scanner.startScan();
scanner.deviceStream.listen((device) async {
if (device.name?.contains('SK58') == true) {
scanner.stopScan();
// Connect and print
final printer = await Sk58Printer.connect(device);
await printer.printText('Hello World!');
await printer.printQrCode('https://example.com');
await printer.feedLines(3);
await printer.disconnect();
}
});
Features
- Bluetooth device scanning
- Connect/disconnect to SK58 printers
- Print text with alignment and styling
- Print QR codes
- Support for Android and Linux
Classes
- BarcodeConfig
- Barcode configuration options.
- BlackMarkPositions
- Black mark detection positions from SK58 manual.
- BleDevice
- EscPosCommands
- ESC/POS command builder for SK58 printer.
- LabelCommands
- Label-specific ESC/POS commands for SK58 printer.
- LabelPrintConfig
- Convenience class for configuring label printing session.
- ProcessedImage
- Processed image ready for printing.
- Sk58Connection
- Manages Bluetooth connection to an SK58 thermal printer.
- Sk58Constants
- Configuration constants for SK58 printer Bluetooth communication.
- Sk58CustomLabel
- Custom label configuration for non-standard sizes.
- Sk58ImageProcessor
- Image processor for converting images to printer-compatible format.
- Sk58Label
- A simple label with title, optional subtitle, and optional QR/barcode.
- Sk58Permissions
- Handles platform-specific permission requests for Bluetooth operations.
- Sk58PrintBuilder
- Fluent builder for creating complex print jobs.
- Sk58Printer
- High-level API for interacting with SK58 thermal printer.
- Sk58Scanner
- Bluetooth scanner for discovering SK58 thermal printers.
- Sk58Specs
- Hardware specifications for SK58 printer.
- Sk58Template
- Base class for all printable templates.
- Sk58TextStyle
- Text style configuration for printing.
- Sk58TwoColumnLabel
- A label with a title and rows of key-value pairs.
Enums
- BarcodeHriPosition
- Position of Human Readable Interpretation (HRI) text.
- BarcodeType
- Supported barcode types for ESC/POS printers.
- QrErrorCorrection
- QR code error correction levels.
- Sk58Align
- Text alignment options for printing.
- Sk58FontSize
- Font size options for printing.
- Sk58LabelSize
- Predefined label sizes for SK58 printer.
- Sk58PaperType
- Paper type modes for SK58 printer.
- Sk58PermissionResult
- Result of permission check operation.
Constants
- sk58MaxWidth → const int
- Maximum effective print width for SK58 printer.
Exceptions / Errors
- BarcodeException
- Exception thrown when barcode data is invalid.
- ImageProcessingException
- Exception thrown when image processing fails.
- Sk58ConnectionException
- Exception thrown when printer connection operations fail.
- Sk58ScanException
- Exception thrown when scanning for Bluetooth devices fails.