Muhammad Luqman Asif
Muhammad Luqman Asif

Reputation: 21

how i can scan ID Card(NIC) in flutter and also get data from it?

I am building an app in flutter and in that app one step is to scan an id card (NIC) and get their name, DOB, expiry date, etc, so I am confusing that how I can scan and get data. is any package in a flutter, which can help me.

Upvotes: 2

Views: 3914

Answers (2)

Boommeister
Boommeister

Reputation: 2127

This package does exactly what you want: https://pub.dev/packages/flutter_mrz_scanner

I implemented it today in my flutter app. First it didn't start with this error:

Class 'MRZScannerFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory

But after following this issue by replacing this it worked:

In FlutterMrzScannerPlugin.kt

class MRZScannerFactory(private val messenger: BinaryMessenger) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context?, id: Int, o: Any?): PlatformView {
    return MRZScannerView(context!!, messenger, id)
}
}

(context!! instead of context?)

However, on my phone Xiaomi Mi9T takes very long until it works and the plugin recognizes my German ID, so it's almost unusable. But it's the only free plugin I found for scanning IDs. I'll try it with an iPhone and another ID in the next days, maybe that works better.

Upvotes: 0

Niasesan
Niasesan

Reputation: 11

U can use MLKIT to extract data from ID into input field

Upvotes: 1

Related Questions