invoice_kit 0.2.0
invoice_kit: ^0.2.0 copied to clipboard
Generate customizable invoice, bill, and receipt PDFs in Flutter with multiple templates, JSON-driven layouts, GST support, QR codes, and cross-platform export.
0.2.0 #
Added #
TemplateConfig.singleTaxLabel(default'GST'): controls the labelClassicTemplateuses for its single combined-rate tax row (the row driven byLineItem.igstPercentwhen no CGST/SGST split is present). Previously this row was hardcoded to the literal text'IGST'with no percentage shown; it now reads e.g.GST (18%)by default, or setsingleTaxLabel: 'IGST'to keep the old wording for genuine interstate invoices. Threaded throughTemplateConfig.copyWith.- CGST/SGST split rows and all other templates (Modern, Compact, Thermal, JSON, BusService) are unaffected β only
ClassicTemplate's dedicated IGST row used the old hardcoded label.
0.1.0 #
Initial production release of invoice_kit.
Features #
- π¨ 5 built-in templates: Classic (B2B with GST), Modern (minimalist), Compact (events/retail), Thermal (80mm POS), JSON-driven (fully dynamic)
- π Dual data API: Strongly-typed Invoice models OR raw JSON InvoiceData for server-driven flows
- π° GST-ready with CGST/SGST/IGST breakdown, multi-currency (default INR), multi-locale number formatting
- π€ Full Unicode support (βΉ, Hindi, Tamil, Arabic, Chinese, etc.) via Google Fonts (Roboto, Noto Sans)
- π± QR code generation for UPI payment links and other payment methods
- π¨οΈ Cross-platform PDF actions: generate, download, share, print, save to device
- π Cross-platform support: Android, iOS, Web, Windows, macOS, Linux
- π§© Custom templates via InvoiceTemplate interface
- π JSON template specifications for white-label and server-driven invoices
- π Type-safe Dart with sound null safety
- π§ͺ Comprehensive unit tests with 100% test pass rate
- π Complete dartdoc API documentation with examples
Models #
Invoice: Strongly-typed invoice with seller, buyer, items, payment infoParty: Business/customer details with optional GST, bank, UPI infoLineItem: Line items with quantity, unit price, discounts, CGST/SGST/IGSTTotals: Auto-calculated totals with tax breakdownPayment: Payment method and status trackingTax: Tax breakdown model
Core API #
InvoiceGenerator: Main public API for generate, download, share, print, saveToDevice, previewTemplateConfig: Customization (colors, fonts, logo, signature, currency, locale)PlaceholderResolver: {{dot.notation.paths}} with {{formatters | currency | date:pattern}}
Built-in Templates #
- ClassicTemplate: Detailed B2B invoice with GST columns, bank details, signature
- ModernTemplate: Clean minimalist design with color sidebar
- CompactTemplate: Event/retail invoice matching City Event reference design
- ThermalTemplate: 80mm thermal receipt for POS systems
- JsonTemplate: Fully dynamic JSON-driven templates with validation
Utilities #
CurrencyFormatter: Multi-currency, multi-locale (default en_IN)DateFormatter: Localized date formatting with custom patternsNumberFormatter: Indian (1,23,456.78) and international (123,456.78) number formatsColorUtils: Hex β PdfColor conversion with lighten/darken utilitiesFontLoader: Google Fonts (Roboto, Noto Sans) with auto-Unicode detectionQrHelper: UPI QR code generation and generic QR/barcode support
Cross-platform #
- Web: Browser download support
- Mobile (iOS/Android): Share sheet, app documents directory save
- Desktop (Windows/macOS/Linux): System save dialog, documents directory
Dependencies #
pdf: ^3.10.7- PDF generationprinting: ^5.12.0- Cross-platform print, save, shareintl: ^0.19.0- Localization and formattingpath_provider: ^2.1.2- Cross-platform file pathsbarcode_widget: ^2.0.4- QR codes and barcodes