zcs_sdk_plugin 1.0.0 copy "zcs_sdk_plugin: ^1.0.0" to clipboard
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(), and printImage() 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 pauseBetweenCopies parameter (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 copy
    • printFields() - Prints key-value pairs with recursive nesting support
    • printKeyValue() - Formats single KV lines
    • printItemsTable() - Renders items as formatted table
    • printTotals() - Prints financial totals section
    • printQRCodeHelper() - QR code generation
    • createFormat() - Text format helper
    • getStringValue() - Safe value extraction

📚 Documentation #

  • Added comprehensive DYNAMIC_PRINTING_GUIDE.md with examples
  • Added REFACTORING_SUMMARY.md documenting all changes
  • Updated README.md with 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
1
likes
0
points
249
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for ZCS SDK integration. Provides universal dynamic printing for receipts, invoices, and documents with QR codes, dual copies, and configurable layouts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on zcs_sdk_plugin

Packages that implement zcs_sdk_plugin