zcs_sdk_plugin 1.0.0
zcs_sdk_plugin: ^1.0.0 copied to clipboard
A Flutter plugin for ZCS SDK integration. Provides universal dynamic printing for receipts, invoices, and documents with QR codes, dual copies, and configurable layouts.
1.0.0 Major Refactoring #
🎉 Universal Dynamic Printing Engine #
BREAKING CHANGES:
- Removed
printText(),printReceipt(),printQRCode(), andprintImage()methods - Replaced with single universal method:
printDynamic()
✨ New Features #
- Universal Dynamic Printing: Single
printDynamic()method handles all document types- Receipts, invoices, reports, warehouse dispatches, and any custom document
- Automatic field skipping for null/empty values
- Flexible layout styles:
simple,detailed,compact - Smart text handling with auto-wrapping and truncation
- Dynamic QR code generation from any field
- Dual copy printing (customer + merchant)
- Configurable pause between copies: Added
pauseBetweenCopiesparameter (default: 5 seconds) to allow users to cut the first copy before the second one prints - Nested map support for complex data structures
- UTF-8 support for special characters (KSh, etc.)
🔧 Architecture Improvements #
- Helper methods for clean code organization:
printDocumentCopy()- Renders one copyprintFields()- Prints key-value pairs with recursive nesting supportprintKeyValue()- Formats single KV linesprintItemsTable()- Renders items as formatted tableprintTotals()- Prints financial totals sectionprintQRCodeHelper()- QR code generationcreateFormat()- Text format helpergetStringValue()- Safe value extraction
📚 Documentation #
- Added comprehensive
DYNAMIC_PRINTING_GUIDE.mdwith examples - Added
REFACTORING_SUMMARY.mddocumenting all changes - Updated
README.mdwith new API and examples - Added inline code documentation
🎯 Benefits #
- ✅ Reduced code complexity (~300 lines of duplicate code removed)
- ✅ Maximum flexibility for any document type
- ✅ Single API method to learn and maintain
- ✅ Professional output with consistent formatting
- ✅ Easy to extend for new document types
Migration Guide #
Before (v0.x):
await plugin.printText('Hello');
await plugin.printReceipt(receiptData);
await plugin.printQRCode('DATA');
After (v1.0):
await plugin.printDynamic({
'header': 'Hello',
'fields': {...},
'items': [...],
'qrCodeField': 'id',
'id': 'DATA',
}, bothCopies: false);
0.0.1 #
- Initial release with basic printing functionality