pos_universal_printer 0.2.10
pos_universal_printer: ^0.2.10 copied to clipboard
A Flutter plugin for printing POS receipts and labels on various thermal printers. Multi-role routing with Bluetooth & TCP support, custom sticker API with 4 complexity levels.
Changelog #
0.2.10 #
Federated install quality of life #
- App-facing package now declares dependencies on
pos_universal_printer_androidandpos_universal_printer_iosso apps can install from pub.dev without overrides. - Example app updated to depend on
^0.2.10.
0.2.9 #
Connection health & UX #
- Example: add TCP preflight reachability check and connection wait-with-timeout.
- Example: add a "Check Status" action and clearer failure snackbars when device is offline.
Publishing & docs #
- Prep federated platform packages for pub.dev (remove local path deps in platform packages; add proper version constraints).
- README: clarify installation options (pub.dev, git with overrides, local path) and troubleshooting.
0.2.8 #
Fixes and reliability #
- Stronger Bluetooth disconnect: always call native disconnect and disable auto-reconnect on manual disconnect.
- Accurate state after hot reload: adopt existing native Bluetooth socket instead of reconnecting; add targeted disconnect by MAC address.
- Event streaming + periodic resync integration refined to prevent ghost connections.
Example and docs #
- Example auto-scans bonded devices on launch and restores selections with SharedPreferences.
- Simplified README code samples and pointed to the example app for full implementation details.
0.2.7 #
๐ Advanced Sticker Customization #
- Enhanced BeverageStickerPrinter: New modular sticker printing class for restaurants/cafes with per-quantity sticker support
- Font Weight Control: Added
StickerWeightenum (normal, semiBold, bold) with TSPL SETBOLD mapping and software-bold fallback - Flexible Layout Controls: Configurable spacing parameters (
detailsLineHeightMm,afterDetailsSpacingMm,timeBlockMm, etc.) - Smart Details Processing:
- Combined character budget for variants + additions + notes with configurable separator
- Intelligent text wrapping with character-based cutting for consistent line breaks
- Configurable max lines limit to prevent overflow
- Auto-grow height option for dynamic label sizing
- Debug Support: Built-in debug logging for details processing and character counting
- Clean Architecture: Refactored details processing into maintainable helper methods
๐ง Code Quality #
- Improved text wrapping algorithm for better handling of spaced content
- Cleaner separation of concerns in sticker generation logic
- Enhanced configurability for production use cases
0.2.6 #
๐ง Lint Fix #
- Wrap single-line if statements in
looksLikeImagewith braces (style hint from analyzer). - No behavioral changes; improves code style conformity.
0.2.5 #
๐ Documentation #
- Bump install snippet to
^0.2.5(previous README still showed 0.2.4) - No code changes; publish to sync README/version on pub.dev
0.2.4 #
๐ Documentation & Compat Enhancements #
- Added Blue Thermal Printer migration section (compat facade usage & mapping).
- Added logo / image printing guide with
printLogoAndLinesandpreferBitImagefallback notes. - Added troubleshooting matrix (label feed, margins, black logo, scan freeze).
- Added logging & versioning policy sections.
- No runtime code changes; docs-only release.
0.2.3 #
๐ผ Logo & Image Printing (Compat Layer) #
- Added
printLogoAndLines(assetLogoPath:, lines:, preferBitImage:)for singleโpayload (logo + text) printing. - Legacy ESC * bitโimage fallback (
preferBitImage: true) for printers that reject GS v 0 raster. - Threshold tuning (logoThreshold) documented for balancing contrast vs fill.
๐ Blue Thermal Printer Compatibility #
- Added
BlueThermalCompatPrinterfacade (methods:printCustom,printLeftRight,printNewLine,printImageBytes,printBarcode,printQRcode,paperCut) - Simple migration path from
blue_thermal_printerwith almost no code changes - Added alignment + size enums (
Align,Size) mirroring legacy API values
โจ Improvements #
- Restored legacy style leftโright padded alignment with truncation & tail preservation.
- Reduced Bluetooth fragmentation by batching logo + lines before send.
- Added detailed debug logging around image pipeline and bitโimage fallback path.
๏ฟฝ Features #
- Receipt compat + existing multiโrole architecture (cashier/kitchen/sticker)
- Works alongside sticker invoice system (Levels 1โ4)
๏ฟฝ๐ Documentation #
- README updated (logo printing guide, migration, troubleshooting table).
- README restructured: quick overview, migration guide, method mapping table.
- Added examples for compat receipt + sticker APIs.
๐ง Internal #
- Added rawBytesToBitImage helper to image utils for direct conversion.
- Prefer single builder flush to minimize partial writes on slower modules.
- No breaking changes to existing public APIs.
๐ Blue Thermal Printer Compatibility #
- Added
BlueThermalCompatPrinterfacade (methods:printCustom,printLeftRight,printNewLine,printImageBytes,printBarcode,printQRcode,paperCut) - Simple migration path from
blue_thermal_printerwith almost no code changes - Added alignment + size enums (
Align,Size) mirroring legacy API values
๐ฆ Features #
- Receipt compat + existing multiโrole architecture (cashier/kitchen/sticker)
- Works alongside sticker invoice system (Levels 1โ4)
๐ Documentation #
- README restructured: quick overview, migration guide, method mapping table
- Added examples for compat receipt + sticker APIs
๐ Internal #
- No breaking changes to existing public APIs
- Version bump for pub.dev release
0.2.2 #
๐ NEW: 3-Level API for Better User Experience #
LEVEL 1: Super Simple (ONE-LINER)
- Added
CustomStickerPrinter.printInvoice()- Print invoice dengan 1 line code - Perfect untuk pemula yang ingin langsung pakai
LEVEL 2: Template with Options (CUSTOMIZABLE)
- Added
CustomStickerPrinter.printInvoiceSticker()- Template dengan opsi customization - Added
StickerSizeenum:mm40x30,mm58x40,mm40x25,mm32x20 - Added
FontSizeenum:small,medium,large
LEVEL 3: Multi-Menu Restaurant Style (PROFESSIONAL)
- Added
CustomStickerPrinter.printRestaurantOrder()- Print multiple menu items - Added
MenuItemclass untuk data structure - Setiap menu = 1 sticker terpisah (perfect untuk restoran)
LEVEL 4: Full Custom (ADVANCED)
- Existing
CustomStickerPrinter.printSticker()dengan kontrol penuh
๐ Documentation #
- Updated README dengan 4 level complexity examples
- Improved public documentation untuk adoption yang lebih mudah
- Added comprehensive parameter guides
0.2.2 #
- Update README to full English for international developers
- Improved examples with English menu items
- Enhanced professional documentation
0.2.1 #
๐ง Documentation & API Fixes
๐ Documentation Updates #
- Fixed README Examples: Updated all examples to match actual main.dart implementation
- Complete Invoice Style Guide: Added exact invoice implementation from main.dart with proper wrap text and dynamic height
- Bluetooth Connect/Disconnect Guide: Added comprehensive guide with loading states
- Parameter Reference: Complete customization guide for all parameters
๐ ๏ธ API Consistency #
- README now matches main.dart: All examples are now consistent with working implementation
- Invoice Style Example: Shows proper 2-menu example with
_printSingleMenuStickerOnlymethod - Text Wrapping: Includes
_wrapTexthelper for automatic text wrapping - Dynamic Height: Proper
clamp(15.0, 30.0)implementation
๐ New Documentation Sections #
- Font size guide (Font 1-8 with size multipliers explanation)
- Complete parameter reference for customization
- Bluetooth scanning with loading states
- Left-right same line positioning examples
0.2.0 #
๐ Major Feature Update - Custom Sticker API & Invoice Templates
๐ New Features #
- Custom Sticker API: Complete helper for TSPL sticker printing with easy-to-use
StickerTextandStickerBarcodeclasses - Text Alignment: Support for 'left', 'center', 'right' alignment with automatic positioning
- 4-Side Margins: Full control with
marginLeft,marginTop,marginRight,marginBottom - Invoice Style Templates: Ready-to-use invoice printing with customer names, timestamps, and modifications
- Built-in Templates:
printProductSticker40x30()andprintAddressSticker58x40()for common use cases - Auto Text Wrapping: Smart text wrapping that preserves whole words
- Dynamic Heights: Automatic sticker height calculation based on content
๐ง Improvements #
- Enhanced Documentation: Comprehensive examples and parameter explanations
- Better Font Support: Validated font ranges (1-8) with size multipliers
- Orientation Fix: TSPL
DIRECTION 0for proper sticker orientation - Multi-line Support: Easy handling of multiple text lines with proper spacing
๐ New Examples #
- Invoice style printing with customer data
- Product and address label templates
- Text alignment demonstrations
- Left-right same line positioning
- Full margin control examples
๐ Bug Fixes #
- Fixed upside-down text in TSPL stickers
- Corrected text positioning calculations
- Improved error handling in connection management
0.1.3 #
- Fix repository URL and add more examples.
0.1.2 #
- Fix repository URL to point to the package subdirectory in the monorepo for pub.dev verification.
0.1.1 #
- Add example/, LICENSE, README improvements, and API dartdoc.
- Fix analyzer warnings and formatting.
- Prep for pub.dev publishing flow and improve documentation.
0.1.0 #
- Initial release of the federated interface package.
- ESC/POS, TSPL, CPCL support via builders.
- Role-based printer mapping.
- Android Bluetooth Classic and TCP; iOS TCP.
- Basic receipt renderer and cash drawer command.
0.1.3 #
- README: update install snippet to ^0.1.3 and add full example app.
- Public exports for builders/renderers; package example uses them.