SmartPrinterFlutterPlatform class abstract
Abstract class that defines the platform interface for SmartPrinterFlutter. This class should be extended when implementing platform-specific functionality (e.g., using MethodChannel for Android or iOS).
- Inheritance
-
- Object
- PlatformInterface
- SmartPrinterFlutterPlatform
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isConnected
→ Future<
bool> -
Checks if a printer is currently connected.
no setter
-
isScanningStream
→ Stream<
bool> -
A stream that indicates the current scanning state (true if scanning).
no setter
-
peripheralsStream
→ Stream<
List< Peripheral> > -
A stream that emits a list of discovered Bluetooth peripherals.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
statusStream
→ Stream<
PrinterStatus> -
A stream that emits real-time status updates from the printer.
no setter
Methods
-
connectBluetooth(
String mac) → Future< void> -
Connects to a printer via Bluetooth using the printer's
macaddress. -
connectEthernet(
String ip) → Future< void> -
Connects to a printer over Ethernet using the provided
ipaddress. -
connectSerial(
String port, String baudrate) → Future< void> -
Connects to a printer via Serial (COM) port with a given
portandbaudrate. -
connectUSB(
String path) → Future< void> -
Connects to a printer via USB using the device
path. -
cutPaper(
) → Future< void> - Sends a cut paper command to the POS printer.
-
disconnect(
) → Future< void> - Disconnects from the currently connected printer.
-
getPrinterStatus(
) → Future< String> - Requests the current printer status (int code mapped in Dart).
-
initializeBle(
) → Future< void> -
isScanning(
) → Future< bool> - Checks whether a Bluetooth scanning process is currently active.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
posPrintBarcode(
String content, {PBarcodeType type = PBarcodeType.code39, PStringEncoding encoding = PStringEncoding.utf8}) → Future< void> - Prints a barcode to the POS printer.
-
posPrintImage(
String base64Encoded, double width) → Future< void> - Prints a base64-encoded image to the POS printer.
-
posPrintQRCode(
String code, {int unitSize = 5, ErrLevel errLevel = ErrLevel.L, PStringEncoding encoding = PStringEncoding.utf8}) → Future< void> - Prints a QR code to the POS printer.
-
posPrintText(
String text, {PTextAlign align = PTextAlign.left, PTextAttribute attribute = PTextAttribute.normal, PTextW width = PTextW.w1, PTextH height = PTextH.h1}) → Future< void> - Prints a text string to the POS printer with optional formatting options.
-
startScan(
) → Future< void> - Starts scanning for available Bluetooth printers.
-
stopScan(
) → Future< void> - Stops the Bluetooth scanning process.
-
toString(
) → String -
A string representation of this object.
inherited
-
tsplPrintImage(
String base64Encoded, int width) → Future< void> - Prints an image (base64-encoded) on TSPL printers.
-
tsplPrintPDF(
String filePath, LabelSize labelSize) → Future< void> - Prints a PDF file by specifying the file path and label size.
-
tsplPrintPDFBase64(
String base64Encoded, LabelSize labelSize) → Future< void> - Prints a base64-encoded PDF directly on TSPL printer.
-
tsplPrintQRCode(
String code, {int x = 0, int y = 0, ErrLevel errLevel = ErrLevel.L, QRCodeMode mode = QRCodeMode.M, int rotate = 0}) → Future< void> - Prints a QR code on TSPL printers.
-
tsplPrintText(
String text, {PTextAlign align = PTextAlign.left, PTextAttribute attribute = PTextAttribute.normal, PTextW width = PTextW.w1, PTextH height = PTextH.h1}) → Future< void> - Prints text on TSPL printers with optional formatting.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ SmartPrinterFlutterPlatform
-
The current platform-specific implementation of SmartPrinterFlutterPlatform.
getter/setter pair