typhoon_ocr_flutter 1.3.1
typhoon_ocr_flutter: ^1.3.1 copied to clipboard
Type-safe Flutter client for Typhoon OCR with local, OpenTyphoon Cloud, and custom backend providers.
1.3.1 #
Package health #
- Widened the
printingdependency constraint to>=5.12.0 <6.0.0so newer Dart/Flutter toolchains can resolve the latest compatible 5.x release while older supported SDKs continue resolving an older compatibleprintingversion. - Kept the package compatibility baseline at Dart >=3.2.0 and Flutter >=3.16.0.
- No public API or runtime behavior changes.
1.3.0 #
Thai document models #
- Added typed
ThaiDriverLicense,ThaiTaxInvoice, andTabienBaandocument models. - Added default OCR definitions and parser routing for all three new document types.
- Added
ThaiDriverLicenseValidatorwith conservative national-ID checksum and date-order checks. - Added
ThaiTaxInvoiceValidatorfor tax IDs, monetary values, VAT arithmetic, and line-item invariants without hard-coding a mandatory VAT rate. - Added
TabienBaanValidatorthat supports partial scans, preserves household member order, and avoids forcing Bangkok/provincial address terminology into one schema. - Added parser and validator regression coverage for Thai-only and mixed Thai/English payloads.
1.2.0 #
PDF extraction #
- Added
TyphoonOCR.extractFromPdf<T>()for typed multi-page PDF OCR. - Rasterizes PDF pages to PNG in source order and reuses the existing typed image extraction pipeline for every page.
- Added injectable
PdfPageRasterizersupport for testing and custom rendering environments. - Added typed
TyphoonPdfExceptionandTyphoonPdfPageExceptionerrors, including a one-based failing page number. - PDF extraction is sequential by default to preserve page order and avoid provider request bursts.
- Added PDF page-ordering, partial-failure, empty-document, and DPI validation tests.
- Added a
printingdependency constrained to the Flutter 3.16 / Dart 3.2 compatible 5.12.x line.
1.1.1 #
Documentation #
- Updated English and Thai installation snippets to use
typhoon_ocr_flutter: ^1.1.1so the README shown on pub.flutter-io.cn matches the published package version. - Expanded the Thai section of
doc/CODE_WALKTHROUGH.mdto cover the same architecture and execution flow as the English walkthrough. - No API or runtime behavior changes.
1.1.0 #
Validation #
- Added
ValidationIssue,ValidationSeverity,ValidationResult<T>, andDocumentValidator<T>. - Added
TyphoonOCR.validate<T>()andextractValidated<T>()without changing existingextract<T>()behavior. - Added built-in Thai ID, receipt, bank-slip, and passport validators with error/warning severity.
- Hardened validation dispatch to use the concrete document runtime type.
- Reject non-finite monetary values and avoid assuming whether receipt item
priceis a unit price or a line total.
Architecture #
- Refactored platform-neutral document models, parser, definitions, document types, exceptions, and validation into an internal pure-Dart core layer under
lib/src. - Kept
typhoon_ocr_flutteras the only published package; no additional package is required by consumers. - Preserved the existing
package:typhoon_ocr_flutter/typhoon_ocr_flutter.dartpublic API.
Quality #
- Added a minimum Flutter 3.16.0 / Dart 3.2 CI job.
- Enabled
public_member_api_docsand enforce at least 80% line coverage. - Expanded provider contract, parser edge-case, and structured-validation regression coverage.
- Restored root-package
dart pub publish --dry-runvalidation for the 1.1.0 release.
1.0.0 #
Initial stable release.
API and architecture #
- Added
TyphoonOCRwith typed document extraction and pluggable providers. - Added
DocumentDefinition<T>registry support so consumer-defined document models can be registered without changing the extraction client. - Changed
TyphoonDocumentto anabstract classso built-in models in separate Dart libraries and consumer-defined models can extend it safely. - Added
TyphoonOCR.fromEnv()configuration for local, cloud, and custom providers. - Added runtime
Platform.environmentsupport as a fallback/override for--dart-define, making CLI and test configuration easier. - Added per-request
ExtractionOptionsfor prompt, mode, and timeout overrides without mutating registered document definitions.
Providers #
- Added
LocalVllmProviderfor OpenAI-compatible local/vLLM hosts. - Added
OpentyphoonCloudProviderfor OpenTyphoon Cloud. - Added
CustomBackendProviderfor application-owned backend endpoints. - Added configurable request timeouts and injectable HTTP clients.
- Added typed configuration, network, timeout, API, and parsing exceptions.
- Added MIME detection for JPEG, PNG, WebP, HEIC, and HEIF images.
Documents and parsing #
- Added typed Thai ID card, receipt, bank slip, passport, and general document models.
- Added Thai national ID 13-digit checksum validation.
- Added immutable
rawMapaccess so provider fields not represented by the typed model are preserved. - Expanded receipt fields with branch, items, subtotal, VAT, total, and payment method.
- Expanded bank-slip fields with sender/receiver details, amount, fee, currency, date/time, reference, and transaction ID.
- Expanded passport fields including MRZ lines.
- Improved mixed-markdown JSON extraction, including responses containing valid metadata JSON before the actual document JSON.
Example and documentation #
- Added a camera/gallery Thai ID example application.
- Added English and Thai README documentation.
- Added provider setup examples, OpenTyphoon API-key instructions, security guidance, and
--dart-defineusage. - Added a code walkthrough covering architecture, providers, parsing, models, tests, and extension points.
Quality #
- Added unit tests for typed extraction, custom definitions, request-level extraction overrides, Thai ID validation, parser edge cases, MIME detection, runtime environment configuration, and OpenTyphoon provider HTTP contract.
- Added GitHub Actions CI gates for formatting, static analysis, tests, example analysis, coverage generation, and package publish validation.