easy_blue_printer 2.2.0 copy "easy_blue_printer: ^2.2.0" to clipboard
easy_blue_printer: ^2.2.0 copied to clipboard

The **Easy Blue Printer** plugin allows seamless integration of Bluetooth printers in a Flutter app, enabling the scanning, connection, and printing functionality.

Changelog #

2.2.0 - 2026-09-17 #

Fixed #

  • Print futures resolved before anything was sent: printData, printEmptyLine and printImage only append bytes to a native buffer — the socket is written by commitPrint, which ran after their futures had already completed and which nobody awaited. await printImage(...) therefore returned with the whole raster still in memory, so callers announced the document as printed while the paper was still coming out, and an IOException raised mid-transfer landed on a future with no listener. Each job's future is now completed only once the commit carrying its bytes has finished, and a failed commit reports the error to every call it was carrying.
  • Chunk pacing on narrow paper: the send rate was a fixed 28.8 KB/s, derived from a 80mm roll (72 bytes per line at ~400 lines/s). On a 58mm roll a line is 48 bytes, so the data was fed 1.5x faster than it printed. The rate is now derived from the configured paper width on both platforms, which keeps 80mm at the same 28.8 KB/s and drops 58mm to 19.2 KB/s.
  • iOS had no pacing at all: with .withoutResponse writes, CoreBluetooth accepted chunks far faster than the printer could burn them. The same paper-speed floor now applies per chunk; where the write handshake is already slower than the paper, it adds no wait.

2.1.0 - 2026-09-17 #

Added #

  • Print density: PaperConfig now accepts an optional density (PrintDensity.normal / dark / darkest), sent to the printer as ESC 7. Omitting it keeps the factory heating and sends no command at all, so existing behaviour is unchanged. The setting is re-applied after each image, since the ESC @ that ends a raster resets it.

Fixed #

  • Image banding: raster data is now split into 64-line GS v 0 blocks instead of one giant command. A single command kept many printers busy for tens of seconds without printing, and they gave up mid-stream and fell back to text mode — the rest of the bytes came out as garbage characters on the paper.
  • Transparent PNGs: fully transparent pixels are treated as blank on both platforms. On Android decodeBitmap now reads the alpha channel; on iOS the scaling context is no longer opaque, which was flattening the image onto a black background before the alpha was ever seen. A PNG with a transparent background printed solid black.
  • Android flow control: chunk pacing now follows the speed the paper actually comes out (~28.8 KB/s) with a 512-byte chunk, instead of a fixed delay per chunk. Feeding slower than the print speed only made the printer wait; feeding faster overran its buffer.

2.0.0 - 2026-09-10 #

Toolchain modernization release. No public Dart API changed — the major bump reflects the raised platform/SDK floors, which are breaking for existing consumers.

Breaking #

  • Minimum SDK: bumped to Flutter 3.44 / Dart 3.12.
  • Android — Built-in Kotlin: the plugin no longer applies the Kotlin Gradle Plugin (kotlin-android). Kotlin compilation is now provided by the Android Gradle Plugin, following the official migration guide. This removes the Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP) warning and keeps the plugin buildable on future Flutter versions. compileSdk raised from 31 to 36 and Java/JVM target from 11 to 17.
  • iOS — Swift Package Manager: added ios/easy_blue_printer/Package.swift. Sources moved from ios/Classes/ to ios/easy_blue_printer/Sources/easy_blue_printer/ and PrivacyInfo.xcprivacy alongside them. The podspec was updated to the new paths, so CocoaPods keeps working — apps on either integration are supported.
  • iOS minimum version: raised from 12.0 to 13.0 (required by Flutter 3.44+).
  • Android minimum SDK: raised from 21 to 24, matching the floor Flutter 3.44+ enforces on apps.

1.4.6 - 2026-04-08 #

Docs #

  • Updated CHANGELOG to document all changes introduced in 1.4.5.

1.4.5 - 2026-04-08 #

Fixed #

  • Android: Reduced chunk size from 512 to 128 bytes to prevent buffer overflow on low-cost printers. Replaced the hardcoded 20 ms inter-chunk delay with an adaptive delay proportional to chunk size (chunkSize / 10 ms, minimum 5 ms). Added up to 2 retries with backoff on IOException per chunk, and validates socket connectivity before each write.
  • iOS: Replaced Thread.sleep(0.02) with real CoreBluetooth backpressure. .withResponse writes now block on a DispatchSemaphore until peripheral(_:didWriteValueFor:) fires (timeout 5 s). .withoutResponse writes check canSendWriteWithoutResponse and block on peripheralIsReady(toSendWriteWithoutResponse:) when the peripheral buffer is full. Chunk size capped at 128 bytes regardless of negotiated MTU. Up to 2 retries per chunk.

Changed #

  • example: Added Full Test button that prints a large text block → image → large text block, exercising the full flow control stack end-to-end.

1.4.4 - 2026-04-07 #

Fixed #

  • Corrupted output when mixing text and image: printImage was sending data in multiple separate socket writes (text flush → image chunks → newlines → reset), creating timing gaps that confused the printer. printImage now only appends the ESC/POS image bytes (alignment + bitmap + trailing feed + reset) to the print buffer — no socket IO. commitPrint then sends the entire buffer (preceding text + image + following text) as one continuous stream via the existing chunked sender, eliminating all gaps.
  • Removed 200ms sleep inside printImage — it was compensating for the gaps between separate write operations, which no longer exist.

1.4.3 - 2026-04-07 #

Fixed #

  • Print queue deadlock: jobs added to the queue while commitPrint was still running (e.g. await printData(...) followed immediately by printEmptyLine(...)) would be silently stuck and never executed. _processQueue now uses a do-while loop so any jobs that arrive during the commitPrint flush are processed in the next iteration instead of being ignored.

1.4.2 - 2026-04-07 #

Fixed #

  • printEmptyLine freeze: flushing all accumulated text inside printEmptyLine caused a large burst that triggered RFCOMM flow control, hanging the printer. printEmptyLine now only appends newlines to the buffer — the buffer is sent as one stream by commitPrint() when the queue empties (or by printImage() before image data).

1.4.1 - 2026-04-07 #

Fixed #

  • Android: Image printing regression introduced in 1.4.0 — alignment bytes were being flushed as a separate Bluetooth packet before the image data, which some printer firmware could not handle. They are now sent together with the first image chunk, restoring the original behavior.

1.4.0 - 2026-04-07 #

Changed (breaking improvement) #

  • Print buffering: printData and printEmptyLine no longer send data immediately. Instead, bytes are accumulated in an in-memory buffer and transmitted as a single continuous stream when:
    • printEmptyLine is called (natural flush point at end of receipt)
    • printImage is called (text is flushed first, then image is sent)
    • The print queue empties (automatic flush for text-only receipts)
  • This eliminates the root cause of corrupted output: the printer now receives one uninterrupted byte stream instead of many small bursts with gaps between them
  • Removed commandDelay (no longer needed)
  • Added internal commitPrint mechanism (called automatically — no API change required)

Fixed #

  • Corrupted characters when printing PDFs with multiple text items and/or images

1.3.9 - 2026-04-07 #

Added #

  • EasyBluePrinter.instance.commandDelay — configurable delay between consecutive print commands (default: 100ms). Increase if your printer still shows corrupted output (e.g. commandDelay = Duration(milliseconds: 150)). Set to Duration.zero to disable.

Fixed #

  • The inter-command delay is only applied when there are more jobs in the queue, so the last command does not add unnecessary latency

1.3.8 - 2026-04-07 #

Fixed #

  • Android: printData now consolidates all ESC/POS bytes into a single buffer and sends in 128-byte chunks with 10ms delays between chunks, preventing printer buffer overflow on receipts with many items
  • iOS: writeData now always applies 10ms delay after each BLE chunk regardless of write type (withResponse or withoutResponse), ensuring consistent flow control across all printer models

1.3.7 - 2026-04-07 #

Fixed #

  • Print queue: Multiple sequential print calls (printData, printImage, printEmptyLine) are now processed one at a time through an internal queue, eliminating corrupted characters caused by buffer overflow on the printer
  • Android: Replaced independent threads with a SingleThreadExecutor for all print operations, ensuring native-level serialization
  • iOS: Replaced DispatchQueue.global() with a dedicated serial queue for print operations, ensuring native-level serialization
  • No more need for manual delays (Future.delayed) between print calls in the consuming app

1.3.6 - 2026-03-31 #

Changed #

  • Updated README with PaperConfig documentation (API reference, quick start, enums table) in English and Portuguese

1.3.5 - 2026-03-30 #

Added #

  • PaperConfig entity to configure paper roll size dynamically (roll58mm = 384px, roll80mm = 576px, or custom widthPixels)
  • EasyBluePrinter.configurePrinter(PaperConfig) method — call once after connecting to set the roll width used for image printing on both Android and iOS

1.3.4 - 2026-02-14 #

  • Updated PIX donation key in README

1.3.3 - 2026-02-11 #

  • FIX README

1.3.2 - 2026-02-11 #

Fixed #

  • iOS: Connected peripheral now appears in scan results even if not discovered during scan
  • Upgraded Flutter SDK to 3.38.9
  • Fixed VS Code launch configuration

1.3.1 - 2026-02-10 #

  • FIX README

1.3.0 - 2026-02-10 #

Added #

  • iOS: Image printing support
  • iOS: isConnected use case
  • iOS: Image processing utilities (scale and bitmap decode)
  • Docs: Complete bilingual README (English and Portuguese) for pub.dev

Fixed #

  • iOS: First scan no longer returns empty — waits for CBCentralManager to be ready before scanning
  • iOS: Scan loading now stays visible until devices are found
  • Android: Image printing sends data in chunks to avoid buffer overflow
  • Android: Filter out unnamed devices from scan results

1.2.7 - 2025-02-26 #

release #

  • Added: Fix erros

1.2.6 - 2025-02-26 #

release #

  • Added: Fix connect to device

1.2.5 - 2025-02-25 #

release #

  • Added: Fix get device is connected

1.2.4 - 2025-02-24 #

release #

  • Added: Fix get device is connected

1.2.3 - 2025-02-23 #

release #

  • Added: Fix SDK

1.2.2 - 2025-02-23 #

release #

  • Added: Fix README

1.2.1 - 2025-02-23 #

release #

  • Added: Request bluetooth permissions in constructor

1.2.0 - 2025-02-15 #

release #

  • Added: Request bluetooth permissions

1.1.4 - 2025-02-15 #

release #

  • Added: Fixed Print Image

1.1.3 - 2025-02-15 #

release #

  • Added: Fixed Print Image

1.1.2 - 2025-02-15 #

release #

  • Added: Function Print Image

1.1.1 - 2025-02-15 #

release #

  • Added: Fixed README EN-US

1.1.0 - 2025-02-15 #

release #

  • Added: Fixed README

1.0.9 - 2025-02-15 #

release #

  • Added: Fixed ndkVersion android

1.0.8 - 2025-02-15 #

release #

  • Added: Fixed permissions android

1.0.7 - 2025-02-14 #

release #

  • Added: Fixed crash

1.0.6 - 2025-02-14 #

release #

  • Added: Fixed name function => scanDevices to getPairedDevices

1.0.5 - 2025-02-14 #

release #

  • Added: Fix version kotlin

1.0.4 - 2025-02-14 #

release #

  • Added: Added THREAD to the functions

1.0.3 - 2025-02-14 #

release #

  • Added: Get device is connected.

1.0.2 - 2025-02-14 #

release #

  • Added: Sdk version.

1.0.1 - 2025-02-14 #

release #

  • Added: Sdk version.

1.0.0 - 2025-02-12 #

Initial release #

  • Added: Bluetooth device scanning functionality.
  • Added: Connect and disconnect functionality for Bluetooth printers.
  • Added: Ability to print text with customizable settings (font size, alignment, bold).
  • Added: Print empty lines for better formatting.
  • Added: Example Flutter app for testing and demonstration of the features.
4
likes
150
points
437
downloads

Documentation

API reference

Publisher

verified publisherlucassilva.dev

Weekly Downloads

The **Easy Blue Printer** plugin allows seamless integration of Bluetooth printers in a Flutter app, enabling the scanning, connection, and printing functionality.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on easy_blue_printer

Packages that implement easy_blue_printer