Skip to content
pubscout

tesseract_ocr

0.6.0, released 6 days ago by zuraffa.com

Flutter plugin for on‑device OCR using Tesseract and Apple Vision.

WASM-ready
$ flutter pub add tesseract_ocr
Source repository

What it does

Provides OCR capabilities on Android, iOS, macOS, Linux and Web by wrapping Tesseract 4 and Apple Vision. Allows configuration of language, engine mode and page segmentation via OCRConfig.

AI-written summary of version 0.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need offline text extraction from images across multiple platforms
  • You require support for many languages and custom traineddata assets
  • You want a single API that works on mobile, desktop and web

Skip it when

  • You need real‑time barcode/QR scanning (use a scanner package)
  • You prefer a pure Dart solution without native dependencies

Strengths

  • Cross‑platform (mobile, desktop, web) OCR support
  • Configurable engines and language assets
  • Handles asset loading and native lifecycle robustly

Weaknesses

  • Requires native setup and traineddata assets
  • Large asset size for multiple languages
  • No built‑in UI widgets, only OCR engine

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
3

Add traineddata files to assets, declare them in pubspec.yaml, ensure iOS uses Swift Package Manager or custom CocoaPods, Android needs no extra permissions but includes native libraries

import 'package:tesseract_ocr/tesseract_ocr.dart';

Future<void> runOcr() async {
  final config = OCRConfig(languages: ['eng']);
  final text = await TesseractOcr.extractText('assets/sample.png', config);
  print('Recognized: $text');
}

Alternatives

Packages that do the same job and could replace tesseract_ocr.

Works with

Packages commonly used together with tesseract_ocr: ones it builds on, ones built on it, and its own family.