typhoon_ocr_flutter 1.3.1 copy "typhoon_ocr_flutter: ^1.3.1" to clipboard
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 printing dependency constraint to >=5.12.0 <6.0.0 so newer Dart/Flutter toolchains can resolve the latest compatible 5.x release while older supported SDKs continue resolving an older compatible printing version.
  • 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, and TabienBaan document models.
  • Added default OCR definitions and parser routing for all three new document types.
  • Added ThaiDriverLicenseValidator with conservative national-ID checksum and date-order checks.
  • Added ThaiTaxInvoiceValidator for tax IDs, monetary values, VAT arithmetic, and line-item invariants without hard-coding a mandatory VAT rate.
  • Added TabienBaanValidator that 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 PdfPageRasterizer support for testing and custom rendering environments.
  • Added typed TyphoonPdfException and TyphoonPdfPageException errors, 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 printing dependency 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.1 so the README shown on pub.flutter-io.cn matches the published package version.
  • Expanded the Thai section of doc/CODE_WALKTHROUGH.md to 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>, and DocumentValidator<T>.
  • Added TyphoonOCR.validate<T>() and extractValidated<T>() without changing existing extract<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 price is 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_flutter as the only published package; no additional package is required by consumers.
  • Preserved the existing package:typhoon_ocr_flutter/typhoon_ocr_flutter.dart public API.

Quality #

  • Added a minimum Flutter 3.16.0 / Dart 3.2 CI job.
  • Enabled public_member_api_docs and enforce at least 80% line coverage.
  • Expanded provider contract, parser edge-case, and structured-validation regression coverage.
  • Restored root-package dart pub publish --dry-run validation for the 1.1.0 release.

1.0.0 #

Initial stable release.

API and architecture #

  • Added TyphoonOCR with 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 TyphoonDocument to an abstract class so 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.environment support as a fallback/override for --dart-define, making CLI and test configuration easier.
  • Added per-request ExtractionOptions for prompt, mode, and timeout overrides without mutating registered document definitions.

Providers #

  • Added LocalVllmProvider for OpenAI-compatible local/vLLM hosts.
  • Added OpentyphoonCloudProvider for OpenTyphoon Cloud.
  • Added CustomBackendProvider for 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 rawMap access 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-define usage.
  • 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.
0
likes
160
points
334
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Type-safe Flutter client for Typhoon OCR with local, OpenTyphoon Cloud, and custom backend providers.

Repository (GitHub)
View/report issues

Topics

#ocr #thai #typhoon #document-scanner #api-client

License

MIT (license)

Dependencies

flutter, http, http_parser, path, printing

More

Packages that depend on typhoon_ocr_flutter