Skip to main content

Optimizing Flutter SDK for High-Performance OCR in 2026

Didit's Flutter SDK 4.15.4 wraps native iOS and Android capture, so OCR quality depends on capture and upload rules. ID verification is $0.15 in a workflow and $0.20 via the standalone API.

Optimizing Flutter SDK for High-Performance OCR in 2026

Contents

In this guide

Jump to the part you need.

This guide is for Flutter developers who need OCR on identity documents to be accurate and fast on real devices, not just in a demo. Didit's Flutter package, didit_sdk 4.15.4, wraps the native iOS and Android SDKs, and ID verification costs $0.15 inside a workflow or $0.20 through the standalone API. The caveat: accuracy is decided before OCR runs, so most of the work is capture quality and image upload rules, not a model setting.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Flutter OCR at a glance

What a high-performance OCR flow in Flutter uses, and what each line costs
ItemWhat to usePrice (USD)
Flutter packagedidit_sdk 4.15.4 from pub.devFree
ID document check inside a workflowID Verification feature (ID_VERIFICATION, legacy OCR)$0.15 per check
ID document check server to serverPOST /v3/id-verification/$0.20 per check
Full KYC bundleID verification + passive liveness + face match + device and IP analysis$0.33 per check
NFC passport or eID readingAdd-on, iOS 15.0+ and Android API 23+$0.15 per check
Custom document extractionDocument AI, fields you define$0.20 per document
Free monthly creditFree plan, work email$10.00
Sandbox testingEvery planFree and unlimited

Start free in the sandbox at business.didit.me, with no sales call. If you want an AI assistant to wire the integration for you, connect Didit through the MCP server. Plan terms and every unit price sit on the Didit pricing page.

What high-performance OCR actually needs from a Flutter app

Document OCR is a capture problem before it is a model problem. The engine reads the file that reaches Didit's API. A blurred frame, glare across the machine readable zone, or a document corner outside the frame lowers extraction quality and raises warnings, from COULD_NOT_RECOGNIZE_DOCUMENT to field-level extraction failures. The SDK's contribution is giving the person a frame worth reading: it handles camera permissions, on-device capture, NFC and liveness out of the box, which the native SDK overview recommends over WebView integrations.

Speed comes from the delivery mode. A native SDK talks to the camera and the NFC chip directly, so there is no WebView layer between the person and the capture. The document itself is read by Didit's API, where inference runs at sub-2-second p99, and the same endpoint covers authenticity checks, MRZ parsing, barcode decoding and cross-field validation, as described in the ID Verification overview.

The Flutter package is deliberately thin. Flutter 4.15.4 pins native 4.15.4 and adds no Dart API of its own, so the capture behaviour you get on iOS and Android is the native behaviour. Your optimization work therefore lands in three places: which SDK you open the flow with, which images you upload, and how you read the result.

Prerequisites

  • Flutter 3.41+ and Dart 3.11+, the floor published in the SDK availability table.
  • iOS 13.0+, with iOS 15.0+ for NFC; Android API 23+ (Android 6.0).
  • A Didit organization and a workflow that contains ID Verification. The canonical feature enum is ID_VERIFICATION; OCR is the legacy name and still resolves.
  • An API key held on your server, never in the app bundle.
  • Document coverage you expect: 14,000+ document types, 220+ countries and territories, 54 capture languages, and 130+ document-recognition languages.
  • A manual-review destination for results that come back In Review.

How to optimize the Didit Flutter SDK for OCR, step by step

  1. Add the package at a pinned version. Install didit_sdk 4.15.4 from pub.dev with flutter pub add didit_sdk, then check the Flutter and Dart floors above before you build. Pinning keeps the native pin at 4.15.4, so an unexpected Dart-side change cannot move the capture code under you.
  2. Create the workflow. Use the Business Console or POST /v3/workflows/ with the ID Verification feature. Restrict it to the document types and countries you actually onboard, using the workflow's document settings, so a document outside that set is not accepted into the flow.
  3. Create the session on your backend. Call POST /v3/session/ with workflow_id, vendor_data and callback. The response carries a session id and session.url. Nothing about the API key reaches the device.
  4. Open the flow with the SDK, not a WebView. Pass the returned URL through the SDK so iOS and Android own camera permissions, capture, NFC reading and liveness. This is the main performance decision in the integration.
  5. Capture the whole document, unprocessed. Tell the person to fill the frame with all four corners, avoid glare on the MRZ, and hold still. Do not pre-crop or de-skew in Dart: the service detects, aligns and crops the document itself, and pre-cropping can remove corners needed for detection.
  6. Read the decision from your backend. Call GET /v3/session/{sessionId}/decision/ or subscribe to session.status.updated. Results arrive under id_verifications[], one entry per document collected in the workflow.
  7. Map status and warnings to your screens. Branch on Approved, In Review and Declined, and show the first terminal warning's long_description rather than a generic error.
  8. Use the standalone endpoint when you already hold the images. POST https://verification.didit.me/v3/id-verification/ takes front_image and, for two-sided documents, back_image. Same engine, no hosted flow, $0.20 per call.
  9. Keep the native layer at 4.10.0 or later for biometric consent. Where Illinois, Texas or Colorado law applies, the consent step needs native 4.10.0 or later. Below that, or when the SDK does not report its version, the session runs as before and the decision reports biometric_consent.status: "pending" with reason: "BIOMETRIC_CONSENT_UNSUPPORTED_SDK".

Flutter package and entry point

The package is distributed on pub.dev as didit_sdk, and the 4.15.4 release pins native 4.15.4. Declare it in your pubspec and treat the native layer as the thing you are integrating:

dependencies:
  flutter:
    sdk: flutter
  didit_sdk: ^4.15.4

The Flutter package adds no Dart API of its own, so the entry point you call and the payload you pass are the ones in the Flutter SDK guide. The value it opens is the session URL that your backend created below.

Runnable example: create the session, then OCR directly

The first block is the documented session call your backend makes. The second block is the documented standalone OCR call, verbatim from the ID Verification API reference.

POST https://verification.didit.me/v3/session/
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
  "workflow_id": "YOUR_WORKFLOW_ID",
  "vendor_data": "user-123",
  "callback": "https://your-app.example.com/didit/webhook"
}
curl -X POST 'https://verification.didit.me/v3/id-verification/' \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'front_image=@./id_front.jpg' \
  -F 'back_image=@./id_back.jpg' \
  -F 'perform_document_liveness=true' \
  -F 'minimum_age=18' \
  -F 'expiration_date_not_detected_action=DECLINE' \
  -F 'invalid_mrz_action=DECLINE' \
  -F 'inconsistent_data_action=DECLINE' \
  -F 'preferred_characters=latin' \
  -F 'save_api_request=true' \
  -F 'vendor_data=user-123'
The document scanning step, with the whole document inside the capture frame
The SDK owns the capture frame. Your job is to keep the document whole inside it.

Expected output

A successful call returns HTTP 200 with the extracted holder fields, the parsed MRZ, any decoded barcodes, a decision status and a warnings array. Approved means no warning resolved to a decline; it does not mean the warnings array is meaningless, so read it anyway.

{
  "request_id": "3f1c8a2e-...",
  "id_verification": {
    "status": "Approved",
    "document_type": "Passport",
    "document_number": "AB1234567",
    "full_name": "Jane Doe",
    "date_of_birth": "1990-04-12",
    "expiration_date": "2031-08-01",
    "warnings": []
  }
}

When save_api_request is left at its default true, the call is stored as an API-type session in the Business Console, request_id is a real session id you can pass to GET /v3/session/{sessionId}/decision/, and the cropped document and portrait images come back as short-lived media URLs. Download them promptly instead of storing the URL.

The analyzing document state shown to the person while the API reads the document
Inference runs at sub-2-second p99, so the analyzing state is short but must still be designed.

Inputs and outputs

Standalone OCR request inputs
InputTypeRequiredNotes
front_imageFileYesUncropped, all four corners visible
back_imageFileFor dual-sided documentsID cards, driver licences
perform_document_livenessBooleanNoDefault true; screens replays, printed copies and portrait manipulation
minimum_ageIntegerNoRaises MIN_AGE_NOT_REACHED
expiration_date_not_detected_actionEnumNoDECLINE or NO_ACTION
invalid_mrz_actionEnumNoDECLINE or NO_ACTION
inconsistent_data_actionEnumNoDECLINE or NO_ACTION
preferred_charactersStringNoExample: latin
save_api_requestBooleanNoDefault true; false stores nothing
vendor_dataStringNoYour own user reference
What comes back, and where to read it
OutputMeaning
statusApproved, In Review or Declined on the document, inside the wider session enum
document_typePassport, identity card, driver's license, residence permit and the other mapped classes
Holder fieldsDocument number, full name, date of birth, expiration date, parsed address
mrz, barcodesParsed machine readable zone and decoded barcode payloads
warnings[]Risk codes with short_description and long_description, per feature and node
Media URLsCropped document and portrait images, short-lived

Allowed file types are tiff, jpg, jpeg, png, webp and pdf, with a maximum of 5 MB per file. Every request accepts up to those limits, and the full field list sits in the data models reference.

Failure cases and recovery

What breaks in a Flutter OCR flow, and what to do about it
SymptomWhat it meansRecovery
HTTP 403, not enough creditsBalance cannot cover the callTop up or move plan; test in the free sandbox first
HTTP 400 multipart validationMissing back_image on a dual-sided document, file over 5 MB, unsupported extensionFix the payload before sending; no processing happens
HTTP 400 COULD_NOT_RECOGNIZE_DOCUMENTThe front image does not match a known official design with high confidence, or cannot be processedAsk for a new capture of the whole document. Do not retry the same file
Declined with a terminal warningDOCUMENT_EXPIRED, SCREEN_CAPTURE_DETECTED, PRINTED_COPY_DETECTED, PORTRAIT_MANIPULATION_DETECTED, SPECIMEN_DOCUMENT_DETECTED, or extraction failures such as NAME_NOT_DETECTEDShow the warning's long_description and stop the flow
In Review with DOCUMENT_LIVENESS_NOT_COMPUTEDThe forgery check returned no usable scoreTreat the document as unchecked and route it to manual review
In ReviewThe result requires manual reviewRoute it to your manual-review queue. Do not approve it from the client
biometric_consent.status: "pending"Native layer below 4.10.0, or no version reportedUpgrade the SDK where those state laws apply
A session detail view in the Didit Business Console showing the ID document result
Every decision, including the ones you route to manual review, lands on a session you can reopen in the console.

Billing is per completed check from prepaid credit. Inside a workflow, the ID document step is $0.15. If the workflow also runs passive liveness ($0.10), face match 1:1 ($0.05) and device and IP analysis ($0.03), the full KYC is $0.33. NFC chip reading is a separate $0.15 add-on. Through the standalone API, each HTTP 200 response consumes one ID Verification API credit at $0.20, and a 403 costs nothing because it is refused before image processing.

Plan side: the Free plan gives $10.00 of monthly credit to eligible organizations that sign up with a work email, phone codes excluded, and unused credit does not roll over. Growth is $99 a month with $115 of credit and 4% off every Didit price; Scale is $299 a month with $350 of credit and 10% off; Enterprise is a custom annual contract starting at $15,000 a year. Sandbox testing is free and unlimited on every plan, and top-ups last 12 months.

Review boundaries are yours. Didit returns a status and a warnings array. It does not approve a person for you. In Review means the result requires manual review, so route it to your own operations queue. Declined is terminal for that document in that flow.

Worked cost example

Assume a Flutter app doing onboarding only, at 2026-11-26 list prices. There are two routes and they are alternatives, not additive: Route A is a session built on a workflow, Route B is the standalone server-to-server call.

Route A: workflow sessions, opened by the Flutter SDK

  • Full KYC: 12,000 x $0.33 = $3,960.00, where $0.33 = $0.15 + $0.10 + $0.05 + $0.03.
  • Custom bank statements through Document AI: 3,000 x $0.20 = $600.00.
  • NFC reading on the passports that have a chip: 1,000 x $0.15 = $150.00.
  • Route A total, covering only full KYC, Document AI and NFC: $3,960.00 + $600.00 + $150.00 = $4,710.00.

Route B: standalone API, images already in your hands

  • ID document checks through the standalone endpoint: 20,000 x $0.20 = $4,000.00.
  • The same 20,000 as ID-only checks inside a workflow: 20,000 x $0.15 = $3,000.00, which is $1,000.00 less for the document step alone.

The two totals are never added together: you pick the route that matches how your app collects the document. On Scale the same full KYC volume from Route A prices at $0.33 x 0.90 = $0.297 per check, so 12,000 x $0.297 = $3,564.00, plus the $299 monthly plan fee. On the Free plan, $10.00 / $0.15 = 66 ID-only checks a month before you pay anything. Current numbers live on didit.me/pricing and in the pricing docs.

Capture rules that decide OCR accuracy

  • Send the whole document. The service classifies, aligns and crops the image itself. Cropping in Dart, or a UI mask that hides the edges, removes the corners the alignment step needs.
  • Keep glare off the MRZ. Keep glare off the machine readable zone, because glare can interfere with reading it.
  • Know what the bundle already covers. Passive liveness is $0.10 and face match 1:1 is $0.05, and both are inside the $0.33 full KYC. If you only need the document read, the ID step on its own is $0.15.
  • Use NFC where the document has a chip and the supported device requirements are met. The chip is read on iOS 15.0+ and Android API 23+, and NFC is a $0.15 add-on to the document check.
  • Stay inside the documented file limits. Accepted types are tiff, jpg, jpeg, png, webp and pdf at 5 MB per file, and an image must be uncropped with all four corners visible. A file outside those limits returns HTTP 400 before any processing runs.

Didit runs identity and fraud checks for 4,000+ companies, and the Flutter SDK is one of five SDKs on the same API: iOS, Android, React Native, Flutter and Web. The Flutter surface is documented in the Flutter SDK guide.

Sources

Next step: open the sandbox at business.didit.me, add didit_sdk to a test app and run one document end to end. The sandbox is free on every plan and there is no sales call.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Frequently asked questions

How do I add OCR to a Flutter app?

Install the Didit Flutter package didit_sdk 4.15.4 from pub.dev, create a workflow that contains the ID Verification feature, then create a session from your backend with POST /v3/session/ and open the returned session.url through the SDK. The extracted fields come back from GET /v3/session/{sessionId}/decision/ in the id_verifications[] array.

Is the Didit Flutter SDK native or a WebView wrapper?

It is a Dart package over the native iOS and Android SDKs, supporting iOS 13.0+ (iOS 15.0+ for NFC) and Android API 23+. Native delivery is why the SDK can control the camera, read NFC chips and run liveness, none of which a WebView handles well. Flutter 4.15.4 pins native 4.15.4 and adds no Dart API of its own.

What does Flutter OCR cost per check with Didit?

An ID document check is $0.15 inside a workflow and $0.20 through the standalone ID Verification API. Full KYC, meaning the document plus passive liveness, face match and device and IP analysis, is $0.33. NFC chip reading is a $0.15 add-on, and the Free plan includes $10.00 of monthly credit.

How accurate is the OCR on difficult documents?

Didit ID Verification covers 14,000+ document types across 220+ countries and territories, with 54 capture languages and 130+ document-recognition languages, and inference runs at sub-2-second p99. Accuracy on any single capture depends on image quality, and the warnings array names the specific failure, for example INVALID_MRZ or INCONSISTENT_DATA, instead of returning a silent wrong value.

Should I crop or de-skew the image before sending it?

No. The documented rule is to upload uncropped photos with all four corners of the document visible, because the service detects, aligns and crops the document itself. Pre-cropping in the Flutter app can remove corners needed for detection and makes recognition worse.

What image formats and size limits does the API accept?

tiff, jpg, jpeg, png, webp and pdf, at a maximum of 5 MB per file. A back_image is required for dual-sided documents such as ID cards and driver licences, and a missing back image returns HTTP 400 before anything is billed.

What does an In Review status mean for my app?

In Review means the result requires manual review, so it must go to a human queue and must not be approved from the client. If it arrives with DOCUMENT_LIVENESS_NOT_COMPUTED, the forgery check produced no usable score and the document should be treated as unchecked.

What does a document recognition error mean in the Didit API?

The API returns HTTP 400 with the error code COULD_NOT_RECOGNIZE_DOCUMENT when the front image does not match a known official document design with high confidence, or cannot be processed at all. Ask the person for a fresh capture of the whole document rather than retrying the same file, which will fail the same way.

Which Flutter, Dart and OS versions are supported?

Flutter 3.41+ and Dart 3.11+, iOS 13.0+ with iOS 15.0+ for NFC, and Android API 23+ (Android 6.0). React Native and Flutter releases in the 4.15.x line pin the matching native version and add no JavaScript or Dart API.

Does OCR run on the device?

Capture runs on the device, and the document is read by Didit's API, which is where the OCR, authenticity checks and cross-field validation happen. The docs do not describe an on-device OCR mode, so design the flow to tolerate a network round trip and handle a failed upload explicitly.

How do I test the Flutter OCR flow without paying?

Sandbox testing is free and unlimited on every plan, so you can run the full capture and decision loop there. When you move to live checks, the Free plan provides $10.00 of monthly credit for eligible organizations that sign up with a work email, which covers 66 ID-only checks at $0.15.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.