thermal_printer_flutter 2.0.0+3
thermal_printer_flutter: ^2.0.0+3 copied to clipboard
A Flutter plugin for thermal printing supporting Bluetooth, USB, and Network printers across Android, iOS, macOS, Windows, Linux, and Web platforms. Easy to use and integrates with esc_pos_utils for g [...]
0.1.0 #
- BREAKING: Renamed
PrinterType.bluethoottoPrinterType.bluetooth. Update call sites fromPrinterType.bluethoottoPrinterType.bluetooth. Serialized data using the legacy"bluethoot"string is still parsed byPrinter.fromMap. - Added USB printing support on macOS (via CUPS)
- Added automatic network printer discovery (
discoverNetworkPrinters) - Fixed
getPlatformVersionto return the platform version through the method channel - Fixed double-result crash on Bluetooth (BLE) for iOS/macOS
- Added a
copiesparameter toprintBytes— copies are now built into the byte stream and sent as a single job, behaving identically on every platform. Prefer this over callingprintBytesin a loop. - Print jobs are now serialized internally, so concurrent/looped
printBytescalls never overlap (a common cause of "runaway"/duplicated printing). - Fixed runaway/multiple-copies on Windows: the spooler now uses
RAWdatatype and forcesdmCopies = 1, so a driver "Copies" default can no longer multiply RAW jobs. Partial/aborted jobs are deleted from the spooler instead of being sent truncated. - Byte payloads are now sent as
Uint8Listacross all platforms - Fixed
flipHorizontalonscreenShotWidget: it was accepted but never applied; the captured image is now actually mirrored. - Improved image print quality:
screenShotWidgetnow downsamples with area-average interpolation and applies Floyd–Steinberg dithering by default (dither: true), greatly improving logos/photos/grayscale on 1-bit thermal printers. Passdither: falsefor the previous threshold-only path (sharper for pure text). - Changed the default
screenShotWidgetwidthfrom550to576(80 mm @ 203 dpi, a multiple of 8) so the bitmap matches the printer head without rescaling. Use384for 58 mm. - Android Bluetooth writes now run on a background thread (single write + flush) instead of blocking the platform/UI thread. This removes the freeze/jank (and ANR risk) during long prints. The whole payload is sent in one write — chunked writes were found to make printing stutter/band — so output stays smooth; raw SPP throughput is gated by the printer, not the plugin.
- Fixed Bluetooth connect failing on Android with "MAC address is required": the Android plugin sent the device address under the
addresskey while Dart expectedbleAddress, so the address arrived empty. Android now sendsbleAddress(matching iOS/macOS) and the Dart parser accepts both keys. - Hardened Bluetooth printer parsing: a malformed paired-device string no longer drops the whole list (
RangeError). BluetoothPrinterRepositoryreconnect delay is now configurable (was a hardcoded 500 ms).- Network discovery now only auto-detects genuinely private subnets (correct
172.16.0.0/12range) and prunes dead pooled connections. - Windows printer status descriptions are now in English (was mixed Portuguese).
- Removed unused internal platform helper.
- USB
isConnectednow returnstrue(connectionless model) instead of relying on an unimplemented/meaningless channel call; usegetPrinterStatusfor real USB health. - Documented the
writebyteswire contract (USB sends aMap, Bluetooth sends raw bytes — this is how macOS routes USB-via-CUPS vs BLE) and locked it with tests. - Documented platform/feature limitations in the README (status, isConnected, single BLE connection, discovery false positives).
- Network discovery can now confirm a candidate is a real printer via an ESC/POS
DLE EOTprobe on port 9100:NetworkPrinterInfo.confirmedflags the result, anddiscoverNetworkPrinters(requireConfirmation: true)returns only confirmed printers (defaultfalsekeeps the previous candidate-listing behavior). - Removed dead
printstring/printBytesmethod handlers from the iOS/macOS plugins (never invoked from Dart). - Fixed Bluetooth discovery on iOS: the Dart layer lists printers via the
pairedbluetoothschannel method, but the iOS plugin only handledgetPrinters, sogetPrinters(printerType: bluetooth)always returned an empty list on iOS. iOS now handlespairedbluetooths(runs a short BLE scan). - Added
dispose()to the plugin to close pooled network connections (prevents leaked sockets on teardown). - Removed the dead
getPrinterschannel handler from the Windows, macOS, iOS and Android plugins (Dart callsusbprinters/pairedbluetoothsdirectly). - Implemented
getPrinterStatuson macOS via CUPS (printer-state/printer-state-reasons), so USB printer status now works on macOS as well as Windows. - Added a GitHub Actions CI workflow: analyze + test (coverage) and example builds for iOS, macOS, Android, Windows and Linux.
- Added unit test coverage (100% of the Dart library).
0.0.1+6 #
- Improved printing performance via Bluetooth
0.0.1+5 #
- Feature add textScaleFactor on Screenshot
0.0.1+4 #
- Dependency Compatibility
0.0.1+3 #
- Resolve bug align in printers bluethoot
- Feature Add Screenshot widget
0.0.1+2 #
- Update readme
0.0.1 #
- Release