Identity Document Detection

Use tensor flow lite for detect identity documents on mobile devices

Platform Support

NOTE: The package maybe add support on future.

Android iOS macOS Windows Linux


Use this plugin in your Flutter app to:

  • Not required network connection.
  • Run on single image and real time.
  • Detect type of a card.
  • Detect side of document.
  • Detect position on image.

on future must detect brightness and sharpness

Getting started

  1. Add identity_document_detection to your pubspec.yaml:

      identity_document_detection: latest_version
  2. Run flutter pub get to install.


You have 2 ways to use it:

  1. Using the IdentityDetector widget
class DetectorPage extends StatelessWidget {
  const DetectorPage({super.key});

  Widget build(BuildContext context) {
    return Center(
      child: IdentityDetector(
        options: IDOptions(
          confidence: 0.85,
          detection: IDTypeDetection.multiple,
          onDocumentDetect: (recognitions) {
            // TODO: Add your own logic here
  1. Creating IDController and initializing it
final detector = await IDController.initialize(widget.options);
_detector = detector;
_subscription = {
  final painter = ObjectDetectorPainter(values);
  _customPaint = CustomPaint(painter: painter);
  setState(() {});

Callback to receive each frame CameraImage perform inference on it

void onImageAvailable(CameraImage cameraImage) async {

And for dispose you should use



For now the package adds a high weight to the project, it must be taken into consideration when taking it to stores, this will improve in the future.

Coming soon

  • Detect brightness on image.
  • Detect sharpness on document.