MethodChannelSmartPrinterFlutter class
Implementation of SmartPrinterFlutterPlatform using MethodChannel.
This class communicates between Flutter and the native Android/iOS implementation via method and event channels. Each printer action (like scanning, printing, cutting, etc.) is invoked through specific channel methods.
- Inheritance
-
- Object
- PlatformInterface
- SmartPrinterFlutterPlatform
- MethodChannelSmartPrinterFlutter
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isConnected
→ Future<
bool> -
Returns whether a device is currently connected.
no setteroverride
-
isScanningStream
→ Stream<
bool> -
Stream that emits a boolean indicating whether scanning is active.
no setteroverride
-
peripheralsStream
→ Stream<
List< Peripheral> > -
Stream of discovered Bluetooth peripherals.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
statusStream
→ Stream<
PrinterStatus> -
Stream that provides printer status updates from the native layer.
no setteroverride
Methods
-
connectBluetooth(
String mac) → Future< void> -
Connects to a printer via Bluetooth using the printer's
macaddress.override -
connectEthernet(
String ip) → Future< void> -
Connects to a printer over Ethernet using the provided
ipaddress.override -
connectSerial(
String port, String baudrate) → Future< void> -
Connects to a printer via Serial (COM) port with a given
portandbaudrate.override -
connectUSB(
String path) → Future< void> -
Connects to a printer via USB using the device
path.override -
cutPaper(
) → Future< void> -
Triggers the paper cutter if available.
override
-
disconnect(
) → Future< void> -
Disconnects the currently connected Bluetooth device.
override
-
getPrinterStatus(
) → Future< String> -
Requests the current printer status from the native layer.
override
-
initializeBle(
) → Future< void> -
override
-
isScanning(
) → Future< bool> -
Returns whether a scan is currently in progress.
override
-
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> -
Sends a barcode to the POS printer.
override
-
posPrintImage(
String base64Encoded, double width) → Future< void> -
Sends an image to the POS printer.
override
-
posPrintQRCode(
String code, {int unitSize = 5, ErrLevel errLevel = ErrLevel.L, PStringEncoding encoding = PStringEncoding.utf8}) → Future< void> -
Sends a QR code to the POS printer.
override
-
posPrintText(
String text, {PTextAlign align = PTextAlign.left, PTextAttribute attribute = PTextAttribute.normal, PTextW width = PTextW.w1, PTextH height = PTextH.h1}) → Future< void> -
Sends text to the POS printer with optional formatting.
override
-
requestBluetoothPermissions(
) → Future< void> -
startScan(
) → Future< void> -
Starts scanning for nearby Bluetooth devices.
override
-
stopScan(
) → Future< void> -
Stops an ongoing scan for Bluetooth devices.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
tsplPrintImage(
String base64Encoded, int width) → Future< void> -
Sends a base64-encoded image to the TSPL printer.
override
-
tsplPrintPDF(
String filePath, LabelSize labelSize) → Future< void> -
Prints a PDF file by specifying the file path and label size.
override
-
tsplPrintPDFBase64(
String base64Encoded, LabelSize labelSize) → Future< void> -
Sends a base64-encoded PDF to be printed using TSPL.
override
-
tsplPrintQRCode(
String code, {int x = 0, int y = 0, ErrLevel errLevel = ErrLevel.L, QRCodeMode mode = QRCodeMode.M, int rotate = 0}) → Future< void> -
Sends a QR code to the TSPL printer with positioning and rotation.
override
-
tsplPrintText(
String text, {PTextAlign align = PTextAlign.left, PTextAttribute attribute = PTextAttribute.normal, PTextW width = PTextW.w1, PTextH height = PTextH.h1}) → Future< void> -
Sends formatted text to the TSPL printer.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited