text_sight 0.0.1
text_sight: ^0.0.1 copied to clipboard
Live, on-device text recognition — Apple Vision on iOS, ML Kit on Android. The text-scanning sibling to mobile_scanner.
Live, on-device text recognition for Flutter — Apple Vision on iOS, ML Kit on Android. Like
mobile_scanner, but for text instead of barcodes.
Why text_sight? #
Most cross-platform OCR plugins run Google ML Kit on both platforms. That quietly pulls
GoogleMLKit into your iOS build — and with it the arm64 and Swift Package Manager warnings
that have been nagging Flutter iOS builds for a while.
text_sight takes the other road. On iOS it uses Apple Vision, a system framework, so your app
links zero third-party ML libraries there — no GoogleMLKit, no warnings. Android keeps ML Kit,
declared only in its own Gradle file. Nothing recognition-related ever reaches your pubspec.yaml,
so the two platforms can't bleed into each other. Clean, native text scanning on both. That's the
whole idea.
A quick taste #
Point the camera at some text:
final controller = TextSightController();
TextSightView(
controller: controller,
onResult: (capture) => capture.lines.forEach((line) => print(line.text)),
overlayBuilder: (context, capture, constraints) => /* paint line.boundingBox */,
);
await controller.start(); // after the camera permission is granted
Or read a single still — no camera, no permission:
final capture = await TextSight.recognizeImage(bytes); // or .recognizePath('/photo.jpg')
Either way, boxes come back normalized [0, 1] from the top-left, identical on both platforms, so
your overlay never has to know which engine drew them.
Want a scan-box? Hand the controller a region of interest —
TextSightController(options: TextSightOptions(roi: Rect.fromLTWH(0.1, 0.4, 0.8, 0.2))) — or change
it, the recognition level, or the torch while the session runs. It applies to the live preview and
the one-shot alike.
The example/ app is where to look next — a live overlay, torch, region-of-interest,
permission handling, and the one-shot screen, all wired up and ready to crib from.
![]() Android · ML Kit |
![]() iOS · Apple Vision |
Platform support #
| Platform | Minimum | Engine |
|---|---|---|
| iOS | 18.0 | Apple Vision — RecognizeTextRequest |
| Android | API 24 | ML Kit Text Recognition v2 (Latin) |
A few things worth knowing before you start: iOS needs 18.0+ (older versions are on the roadmap), Android recognizes Latin script only for now, and live scanning needs a real device — the iOS Simulator has no camera. The one-shot runs anywhere.
Install #
flutter pub add text_sight
On iOS, add a camera-usage string to ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Used to recognize text from the camera.</string>
text_sight won't request camera permission for you — ask for it (e.g. with
permission_handler), then call
controller.start(). Android's manifest already has what it needs.
Going deeper #
How it all fits together — coordinate handling, the per-line confidence contract, how region-of-interest differs across platforms, performance, and what's next — lives in APPENDIX.md.

