blue_thermal_helper 2.0.0
blue_thermal_helper: ^2.0.0 copied to clipboard
Reusable Flutter helper for Bluetooth thermal printer (ESC/POS)
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - 2026-02-03 #
Added #
-
FontSize Manual System ⭐
- Manual font size control with range 6pt-32pt
- 7 preset sizes (extraSmall, small, normal, medium, large, extraLarge, header)
- Support custom font sizes with decimal precision (e.g., FontSize(14.5))
- Automatic ESC/POS multiplier calculation
- New model:
FontSizeclass inlib/src/models/font_size.dart - Method
getCharsPerLine58mm(),getCharsPerLine80mm()for dynamic text wrapping - Method
getPixelWidth58mm(),getPixelWidth80mm()for image calculations
-
Smart Row Alignment ⭐
- New method:
rowLabel(String label, String value, {FontSize size, bool bold}) - New method:
rowLabelCustom(String label, String value, {int labelWidth, FontSize size, bool bold}) - Auto-alignment of ":" separator to be vertically consistent
- Professional-looking formatted rows similar to text editors
- New method:
-
ThermalPaperHelper Enhancement
- New method:
charsPerLineWithFont(ThermalPaper paper, FontSize fontSize) - Dynamic character calculation based on font size
- New method:
-
Comprehensive Documentation
- FONTSIZE_GUIDE.md - Complete guide in Indonesian
- QUICKREFERENCE.md - Quick cheat sheet with 15 sections
- IMPLEMENTATION_SUMMARY.md - Technical implementation details
- COMPLETION_CHECKLIST.md - Project status and checklist
- DOCUMENTATION_INDEX.md - Documentation index and learning paths
- Updated README.md with new features
-
Code Examples
- font_size_demo.dart - 3 comprehensive demo functions
- font_size_example_simple.dart - Simple UI reference with 6 examples
- Updated thermal_printer_sample_screen.dart with new features
Changed #
-
BREAKING CHANGE: Removed enum
ThermalFontSize- Replaced with flexible
FontSizemodel (6pt-32pt range) - All method signatures using
ThermalFontSizeupdated to useFontSize - Migration is straightforward:
ThermalFontSize.large→FontSize.large
- Replaced with flexible
-
Updated
ThermalFontMapper.style()for manual ESC/POS calculation- Now converts FontSize point values to appropriate width/height multipliers
- Supports up to 4x multiplier (standard thermal printer limit)
-
Updated method signatures:
text()- parametersizenow acceptsFontSizeinstead ofThermalFontSizecol()- parametersizeupdatedcolAuto()- parametersizeupdatedrow()- parametersizeupdated, smarter width allocation based on font multiplierrowItem()- parametersizeupdated
Improved #
- Better hierarchy support with 7 preset font sizes
- More professional receipt formatting with smart alignment
- Better documentation with Indonesian language guide
- More flexible font size control without preset limitations
- Automatic calculation reduces manual configuration
Migration Guide #
For users upgrading from v1.x to v2.0:
// OLD (v1.1.0 and before)
receipt.text('Text', size: ThermalFontSize.large);
receipt.row('Label', 'Value', size: ThermalFontSize.normal);
// NEW (v2.0.0)
receipt.text('Text', size: FontSize.large);
receipt.row('Label', 'Value', size: FontSize.normal);
// NEW: Use rowLabel() for better alignment
receipt.rowLabel('Label', 'Value');
See FONTSIZE_GUIDE.md section "Migrasi dari Versi Lama" for detailed migration guide.
1.0.9 - 2026-01-22 #
Fixed #
- Further Adjustment for Text Wrapping
- Adjusted column split from 4-8 to 3-9 for small/normal fonts
- Prevents last digit from wrapping to next line for very long values
- Supports values up to ~30 characters on 58mm paper without any wrapping
- Large fonts use 4-8 split
1.0.8 - 2026-01-22 #
Fixed #
- Text Wrapping Issue for Long Values
- Fixed critical issue where long values (e.g., reference numbers 23+ chars) in
row()method would wrap to next line - Changed column width allocation from 6-6 to 3-9 split for small/normal fonts
- Gives maximum space to value column (right side) to accommodate very long text
- Large fonts use 4-8 split to balance space with larger character size
- Ensures label and value stay on the same line even with very long values (up to ~30 characters on 58mm paper)
- Resolves regression introduced when adding
sizeparameter torow()method
- Fixed critical issue where long values (e.g., reference numbers 23+ chars) in
1.0.7 - 2026-01-22 #
Added #
- Enhanced
row()Method- Added optional
boldparameter torow()method for bold text styling - Added optional
sizeparameter torow()method for font size control (usingThermalFontSizeenum) - Allows more flexible formatting of two-column rows without using
rowColumns()directly - Example:
receipt.row('Total', '100000', bold: true, size: ThermalFontSize.large)
- Added optional
1.0.6 - 2026-01-22 #
Added #
- Extra Small Font Size Support
- Added
ThermalFontSize.extraSmallenum value - Uses alternative font (fontB) for smaller text rendering
- Useful for detailed information like long addresses, footnotes, or disclaimers
- Example usage in sample app for address and footer text
- Added
Changed #
- Updated example app to demonstrate
extraSmallfont size usage - Enhanced documentation with font size examples
1.0.5 - 2026-01-22 #
Improvements #
-
Code Quality Improvements
- Removed code duplication: consolidated
formatMoney()andwrapText()into shared utilities - Refactored internal structure: moved models to
lib/src/models/ - Moved utilities to
lib/src/utils/(internal, not exported) - Cleaned up example app: removed commented code, improved formatting
- Standardized naming conventions throughout codebase
- Removed code duplication: consolidated
-
Documentation
- Added comprehensive dartdoc comments to all public APIs
- Improved code examples in documentation
- Added detailed parameter descriptions
- Enhanced README with better examples
-
API Improvements
- Better separation of public vs internal APIs
- Cleaner export structure in main library file
- More consistent error handling
Fixed #
- Import issues in example app
- Inconsistent formatting in example code
Internal #
- Created
lib/src/utils/formatting_utils.dartfor shared utilities - Created
lib/src/models/bluetooth_printer.dartfor printer model - Created
lib/src/models/thermal_paper.dartfor paper configuration - Removed duplicate files:
printer_paper.dart,receipt_util.dart,receipt_preview.dart
Notes #
- This is a non-breaking release
- All existing code will continue to work without changes
- Internal refactoring improves maintainability without affecting public API
1.0.4+1 Previous #
- Update README
1.0.4 Previous #
- Add Request Enabling Bluetooth ON
1.0.3 Previous #
- Bug Fix Logo Function
1.0.2 Previous #
- Update README
1.0.1 Previous #
- Update README
1.0.0 - 2026-01-06 #
Features #
- BlueThermalHelper core helper
- Scan, connect, disconnect Bluetooth printer
- ThermalReceipt builder abstraction
- ESC/POS real printing support
- Receipt preview (text-based)
- Support paper size via enum (58mm / 80mm)
- Money formatting with auto-alignment
- Auto-wrap item name
- Print receipt from JSON data
Bug Fixes #
- Preview width mismatch with 58mm paper
- Money column alignment edge cases
- Connection status not updating in UI
Release Notes #
- Initial public release
- Tested with 58mm thermal printer
✅ Compatibility #
Tested on Flutter 3.38.5 with real android devices Oppo Reno 14 and PANDA Thermal Printer PRJ-R58B